diff options
author | Grigorii Zimin <gzimin@luxoft.com> | 2020-04-03 17:14:32 +0300 |
---|---|---|
committer | Grigorii Zimin <gzimin@luxoft.com> | 2020-04-03 16:09:40 +0000 |
commit | 7a467588143cacbbf14c3e01c1383734f8fd8f25 (patch) | |
tree | a2be82c79565a7c847ef4d5d9d89a3ef3743cb02 | |
parent | 03263b2298ef8c653179ff77c5a17b51d8f388bb (diff) |
Remove videoplayer as it doesn't work in Neptune UI 5.14
Change-Id: I2d1591c634a6a439a4a47ee0ab43423817188e89
Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
-rw-r--r-- | com.luxoft.videoplayer/ControlsOverlay.qml | 173 | ||||
-rw-r--r-- | com.luxoft.videoplayer/Main.qml | 62 | ||||
-rw-r--r-- | com.luxoft.videoplayer/OpenFilesPanel.qml | 67 | ||||
-rw-r--r-- | com.luxoft.videoplayer/VideoPlayerPanel.qml | 99 | ||||
-rw-r--r-- | com.luxoft.videoplayer/VideoPlayerView.qml | 63 | ||||
-rw-r--r-- | com.luxoft.videoplayer/com.luxoft.videoplayer.pro | 19 | ||||
-rw-r--r-- | com.luxoft.videoplayer/icon.png | bin | 1034 -> 0 bytes | |||
-rw-r--r-- | com.luxoft.videoplayer/info.yaml | 12 | ||||
-rw-r--r-- | com.luxoft.videoplayer/utils.js | 92 | ||||
-rw-r--r-- | qt-auto-extra-apps.pro | 1 |
10 files changed, 0 insertions, 588 deletions
diff --git a/com.luxoft.videoplayer/ControlsOverlay.qml b/com.luxoft.videoplayer/ControlsOverlay.qml deleted file mode 100644 index 96947ca..0000000 --- a/com.luxoft.videoplayer/ControlsOverlay.qml +++ /dev/null @@ -1,173 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 Luxoft Sweden AB -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.3 -import QtMultimedia 5.12 - -import shared.Sizes 1.0 - -import "utils.js" as Utils - -Rectangle { - id: root - color: Qt.rgba(0, 0, 0, .6) - - readonly property bool playingOrPaused: player.playbackState === MediaPlayer.PausedState - || player.playbackState === MediaPlayer.PlayingState - - property bool shouldShow: false - property Video player - - function openFilesPanel() { - filesPanel.visible = true; - } - - signal fileOpenRequested(url fileURL) - - Timer { - id: hideTimer - interval: 2500 - running: root.shouldShow && !filesPanel.visible - repeat: true - onTriggered: { - if (player.hasVideo) { - root.shouldShow = false; - } - } - } - - RowLayout { - id: labelsLayout - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: parent.top - anchors.topMargin: Sizes.dp(24) - - ToolButton { - text: qsTr("Open...") - onClicked: filesPanel.visible = !filesPanel.visible - } - - Label { - Layout.alignment: Qt.AlignHCenter - horizontalAlignment: Text.AlignHCenter - visible: player.hasVideo - Layout.preferredWidth: root.width/3*2 - elide: Label.ElideMiddle - text: Utils.baseName(player.source) - } - - Label { - visible: player.hasVideo - text: "(%1)".arg(Utils.playbackStateToString(player.playbackState)) + (player.muted ? " " + qsTr("Muted") : "") - } - } - - OpenFilesPanel { - id: filesPanel - anchors.left: parent.left - anchors.right: parent.right - anchors.top: labelsLayout.bottom - anchors.bottom: playbackControls.top - anchors.margins: Sizes.dp(24) - visible: false - onFileOpenRequested: root.fileOpenRequested(fileURL) - } - - RowLayout { - id: playbackControls - visible: player.hasVideo - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - height: visible ? implicitHeight : 0 - anchors.margins: Sizes.dp(24) - spacing: Sizes.dp(24) - - Label { - text: Utils.msToTime(posSlider.value) - } - - Slider { - id: posSlider - Layout.fillWidth: true - from: 0 - to: player.duration - value: player.position - enabled: player.seekable - onMoved: { - hideTimer.restart(); - player.seek(value); - } - } - - Label { - text: Utils.msToTime(player.duration) - } - - ToolButton { - id: playPauseButton - Layout.preferredWidth: Sizes.dp(64) - Layout.preferredHeight: Sizes.dp(64) - icon.name: player.playbackState == MediaPlayer.PlayingState ? "ic-pause" : "ic_play" - enabled: player.hasVideo - onClicked: { - hideTimer.restart(); - player.playbackState == MediaPlayer.PlayingState ? player.pause() : player.play(); - } - } - ToolButton { - id: stopButton - Layout.preferredWidth: Sizes.dp(64) - Layout.preferredHeight: Sizes.dp(64) - icon.name: "ic-close" // FIXME probably not the best icon :/ - enabled: root.playingOrPaused - onClicked: { - hideTimer.restart(); - player.stop(); - } - } - ToolButton { - id: muteButton - Layout.preferredWidth: Sizes.dp(64) - Layout.preferredHeight: Sizes.dp(64) - icon.name: checked ? "ic-volume-0" : "ic-volume-2" - enabled: root.playingOrPaused - checkable: true - checked: player.muted - onToggled: { - hideTimer.restart(); - player.muted = !player.muted; - } - } - } -} diff --git a/com.luxoft.videoplayer/Main.qml b/com.luxoft.videoplayer/Main.qml deleted file mode 100644 index d44ef3e..0000000 --- a/com.luxoft.videoplayer/Main.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 Luxoft Sweden AB -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.12 -import application.windows 1.0 -import shared.utils 1.0 - -import "." - -ApplicationCCWindow { - id: root - - MultiPointTouchArea { - anchors.fill: parent - anchors.margins: 30 - touchPoints: [ TouchPoint { id: touchPoint1 } ] - - property int count: 0 - onReleased: { - count += 1; - root.setWindowProperty("activationCount", count); - } - } - - VideoPlayerView { - x: root.exposedRect.x - y: root.exposedRect.y - width: root.exposedRect.width - height: root.exposedRect.height - - state: root.neptuneState - bottomWidgetHide: root.exposedRect.height === root.targetHeight - } -} diff --git a/com.luxoft.videoplayer/OpenFilesPanel.qml b/com.luxoft.videoplayer/OpenFilesPanel.qml deleted file mode 100644 index 0a2d184..0000000 --- a/com.luxoft.videoplayer/OpenFilesPanel.qml +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 Luxoft Sweden AB -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Qt.labs.folderlistmodel 2.11 -import Qt.labs.platform 1.0 - -Item { - id: root - - signal fileOpenRequested(url fileURL) - - FolderListModel { - id: folderListModel - nameFilters: ["*"] - showDirs: false - showDotAndDotDot: false - folder: StandardPaths.standardLocations(StandardPaths.MoviesLocation)[0] - } - - ListView { - anchors.fill: parent - model: folderListModel - delegate: ItemDelegate { - text: model.fileName - contentItem: Label { - rightPadding: parent.spacing - text: parent.text - elide: Text.ElideMiddle - verticalAlignment: Text.AlignVCenter - } - onClicked: { - root.fileOpenRequested(model.fileURL); - root.visible = false; - } - } - } -} diff --git a/com.luxoft.videoplayer/VideoPlayerPanel.qml b/com.luxoft.videoplayer/VideoPlayerPanel.qml deleted file mode 100644 index 71be88f..0000000 --- a/com.luxoft.videoplayer/VideoPlayerPanel.qml +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 Luxoft Sweden AB -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtMultimedia 5.12 - -import "utils.js" as Utils - -Rectangle { - implicitWidth: 800 - implicitHeight: 600 - color: "black" - - Video { - id: videoplayer - anchors.fill: parent - audioRole: MediaPlayer.VideoRole - autoPlay: true - - onStatusChanged: { - console.debug("Video player status changed:", Utils.statusToString(status)) - } - onErrorChanged: { - console.warn("Video player error: %1\n%2".arg(error).arg(errorString)) - } - onPlaybackStateChanged: { - console.debug("Video playback state changed:", Utils.playbackStateToString(playbackState)) - } - onVolumeChanged: { - console.debug("Video player volume changed:", volume) - } - Component.onCompleted: { - console.debug("Video player availability:", Utils.availabilityToString(availability)) - console.debug("Supported audio roles:", supportedAudioRoles()) - } - - focus: true - Keys.onLeftPressed: seek(position - 5000) - Keys.onRightPressed: seek(position + 5000) - Keys.onUpPressed: videoplayer.volume += .1 - Keys.onDownPressed: videoplayer.volume -= .1 - Keys.enabled: videoplayer.seekable - - MouseArea { - anchors.fill: parent - onClicked: controls.shouldShow = !controls.shouldShow - } - - ToolButton { - anchors.centerIn: parent - visible: !videoplayer.hasVideo && !controls.shouldShow - text: qsTr("Open video...") - onClicked: { - controls.shouldShow = !controls.shouldShow; - controls.openFilesPanel(); - } - } - - ControlsOverlay { - id: controls - width: parent.width - height: parent.height - x: parent.x - y: shouldShow ? 0 : parent.height - player: videoplayer - Behavior on y { NumberAnimation {}} - onFileOpenRequested: videoplayer.source = fileURL - } - } -} diff --git a/com.luxoft.videoplayer/VideoPlayerView.qml b/com.luxoft.videoplayer/VideoPlayerView.qml deleted file mode 100644 index 50c5050..0000000 --- a/com.luxoft.videoplayer/VideoPlayerView.qml +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 Luxoft Sweden AB -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.12 -import QtQuick.Layouts 1.3 - -import shared.animations 1.0 -import shared.controls 1.0 -import shared.utils 1.0 -import shared.Style 1.0 -import shared.Sizes 1.0 - -Item { - id: root - - property bool bottomWidgetHide: false - - // Top content background - Image { - id: topContentBg - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - height: Sizes.dp(436) - source: Style.image("app-fullscreen-top-bg") - visible: root.state === "Maximized" - } - - ColumnLayout { - anchors.fill: parent - VideoPlayerPanel { - anchors.fill: parent - } - } -} diff --git a/com.luxoft.videoplayer/com.luxoft.videoplayer.pro b/com.luxoft.videoplayer/com.luxoft.videoplayer.pro deleted file mode 100644 index f0c6bb3..0000000 --- a/com.luxoft.videoplayer/com.luxoft.videoplayer.pro +++ /dev/null @@ -1,19 +0,0 @@ -TEMPLATE = aux - -FILES += info.yaml \ - icon.png \ - Main.qml \ - VideoPlayerView.qml \ - VideoPlayerPanel.qml \ - ControlsOverlay.qml \ - OpenFilesPanel.qml \ - utils.js - -app.files = $$FILES -app.path = /apps/com.luxoft.videoplayer -INSTALLS += app - -AM_MANIFEST = info.yaml -AM_PACKAGE_DIR = $$app.path - -load(am-app) diff --git a/com.luxoft.videoplayer/icon.png b/com.luxoft.videoplayer/icon.png Binary files differdeleted file mode 100644 index 2734956..0000000 --- a/com.luxoft.videoplayer/icon.png +++ /dev/null diff --git a/com.luxoft.videoplayer/info.yaml b/com.luxoft.videoplayer/info.yaml deleted file mode 100644 index 4d22d92..0000000 --- a/com.luxoft.videoplayer/info.yaml +++ /dev/null @@ -1,12 +0,0 @@ -formatVersion: 1 -formatType: am-application ---- -id: 'com.luxoft.videoplayer' -icon: 'icon.png' -code: 'Main.qml' -runtime: 'qml' -name: - en: 'Video Player' - -categories: [ 'other', 'widget' ] -mimeTypes: [ 'x-scheme-handler/x-videoplayer' ] diff --git a/com.luxoft.videoplayer/utils.js b/com.luxoft.videoplayer/utils.js deleted file mode 100644 index 82e8988..0000000 --- a/com.luxoft.videoplayer/utils.js +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 Luxoft Sweden AB -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -.pragma library - -.import QtMultimedia 5.12 as QtMultimedia - -function baseName(str) -{ - var base = String(str).substring(String(str).lastIndexOf('/') + 1); - return base; -} - -function availabilityToString(availability) { - switch (availability) { - case QtMultimedia.MediaPlayer.Available: - return "Available"; - case QtMultimedia.MediaPlayer.Busy: - return "Busy"; - case QtMultimedia.MediaPlayer.Unavailable: - return "Unavailable"; - case QtMultimedia.MediaPlayer.ResourceMissing: - return "Missing resource"; - default: - return "Unknown status: %1".arg(availability); - } -} - -function statusToString(status) { - switch (status) { - case QtMultimedia.MediaPlayer.NoMedia: return "No media"; - case QtMultimedia.MediaPlayer.Loading: return "Loading"; - case QtMultimedia.MediaPlayer.Loaded: return "Loaded"; - case QtMultimedia.MediaPlayer.Buffering: return "Buffering"; - case QtMultimedia.MediaPlayer.Stalled: return "Stalled"; - case QtMultimedia.MediaPlayer.Buffered: return "Buffered"; - case QtMultimedia.MediaPlayer.EndOfMedia: return "End of media"; - case QtMultimedia.MediaPlayer.InvalidMedia: return "Invalid media"; - case QtMultimedia.MediaPlayer.UnknownStatus: - default: - return "Unknown status %1".arg(status); - } -} - -function playbackStateToString(playbackState) { - switch (playbackState) { - case QtMultimedia.MediaPlayer.PlayingState: return qsTr("Playing"); - case QtMultimedia.MediaPlayer.PausedState: return qsTr("Paused"); - case QtMultimedia.MediaPlayer.StoppedState: return qsTr("Stopped"); - default: return qsTr("Unknown playback state %1").arg(playbackState); - } -} - -function msToTime(duration) { - var seconds = Math.floor((duration / 1000) % 60); - var minutes = Math.floor((duration / (1000 * 60)) % 60); - var hours = Math.floor((duration / (1000 * 60 * 60)) % 24); - - hours = (hours < 10) ? "0" + hours : hours; - minutes = (minutes < 10) ? "0" + minutes : minutes; - seconds = (seconds < 10) ? "0" + seconds : seconds; - - return hours + ":" + minutes + ":" + seconds; -} diff --git a/qt-auto-extra-apps.pro b/qt-auto-extra-apps.pro index a4d519a..f1d982f 100644 --- a/qt-auto-extra-apps.pro +++ b/qt-auto-extra-apps.pro @@ -2,7 +2,6 @@ TEMPLATE = subdirs SUBDIRS = com.pelagicore.camera \ com.pelagicore.youtube \ com.luxoft.webbrowser \ - com.luxoft.videoplayer \ com.luxoft.greenomics \ com.pelagicore.samegame \ com.pelagicore.webradio \ |