Browse Source

Merge branch 'master' into release

Ian Walton 3 years ago
parent
commit
14cad9c239

+ 7 - 0
.gitignore

@@ -20,3 +20,10 @@ web-client
 toolchain.cmake
 .sublime-settings
 .last_wc_version
+debian/*.debhelper.log
+debian/.debhelper/
+debian/jellyfin-media-player/
+debian/files
+debian/jellyfin-media-player.substvars
+dist.zip
+obj-x86_64-linux-gnu/

+ 5 - 0
debian/changelog

@@ -0,0 +1,5 @@
+jellyfin-media-player (1.3.0-1) unstable; urgency=medium
+
+  * Initial Debian packaging for 1.3.0
+
+ -- Joshua Boniface <joshua@boniface.me>  Sun, 11 Apr 2021 22:34:40 -0400

+ 1 - 0
debian/compat

@@ -0,0 +1 @@
+9

+ 53 - 0
debian/control

@@ -0,0 +1,53 @@
+Source: jellyfin-media-player
+Section: video
+Priority: optional
+Maintainer:  Ian Walton <ian@iwalton.com>, Joshua Boniface <joshua@boniface.me>
+Build-Depends: debhelper (>= 9),
+               autoconf,
+               automake,
+               libtool,
+               libharfbuzz-dev,
+               libfreetype6-dev,
+               libfontconfig1-dev,
+               libx11-dev,
+               libxrandr-dev,
+               libvdpau-dev,
+               libva-dev,
+               mesa-common-dev,
+               libegl1-mesa-dev,
+               yasm,
+               libasound2-dev,
+               libpulse-dev,
+               libuchardet-dev,
+               zlib1g-dev,
+               libfribidi-dev,
+               git,
+               libgnutls28-dev,
+               libgl1-mesa-dev,
+               libsdl2-dev,
+               cmake,
+               wget,
+               python,
+               g++,
+               qtwebengine5-dev,
+               qtquickcontrols2-5-dev,
+               libqt5x11extras5-dev,
+               libcec-dev,
+               libmpv-dev,
+               wget,
+               unzip
+Standards-Version: 3.9.4
+Homepage: https://jellyfin.org/
+Vcs-Git: https://github.org/jellyfin/jellyfin-media-player.git
+Vcs-Browser: https://github.org/jellyfin/jellyfin-media-player
+
+Package: jellyfin-media-player
+Architecture: any
+Depends: libmpv1,
+         libqt5webengine5,
+         libcec4 | libcec6,
+         qml-module-qtwebengine,
+         qml-module-qtwebchannel,
+         qml-module-qtquick-controls
+Description: Jellyfin is the Free Software Media System.
+ This package provides the Jellyfin desktop media player.

+ 27 - 0
debian/copyright

@@ -0,0 +1,27 @@
+Format: http://dep.debian.net/deps/dep5
+Upstream-Name: jellyfin
+Source: https://github.com/jellyfin/jellyfin-media-player
+
+Files: *
+Copyright: 2018 Ian Walton
+License: GPL-2.0
+
+Files: debian/*
+Copyright: 2021 Joshua Boniface <joshua@boniface.me>
+License: GPL-2.0
+
+License: GPL-2.0
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

+ 0 - 0
debian/install


+ 15 - 0
debian/rules

@@ -0,0 +1,15 @@
+#! /usr/bin/make -f
+
+JWC_RELEASE := 1.7.1
+
+%:
+	dh $@
+
+override_dh_auto_build:
+	dh_auto_build $@
+	wget https://github.com/iwalton3/jellyfin-web-jmp/releases/download/jwc-$(JWC_RELEASE)/dist.zip
+	unzip dist.zip -d obj-x86_64-linux-gnu/
+
+override_dh_auto_clean:
+	dh_auto_clean $@
+	rm dist.zip || true

+ 1 - 0
debian/source/format

@@ -0,0 +1 @@
+1.0

+ 8 - 0
debian/source/options

@@ -0,0 +1,8 @@
+tar-ignore='.git*'
+tar-ignore='**/.git'
+tar-ignore='**/.hg'
+tar-ignore='**/.vs'
+tar-ignore='**/.vscode'
+tar-ignore='deployment'
+tar-ignore='*.deb'
+tar-ignore='ThirdParty'

+ 11 - 6
native/mpvAudioPlayer.js

@@ -48,6 +48,7 @@ class mpvAudioPlayer {
         self._paused = false;
         self._volume = this.getSavedVolume() * 100;
         self._playRate = 1;
+        self._hasConnection = false;
 
         self.play = (options) => {
             self._started = false;
@@ -56,12 +57,15 @@ class mpvAudioPlayer {
             self._duration = undefined;
 
             const player = window.api.player;
-            player.playing.connect(onPlaying);
-            player.positionUpdate.connect(onTimeUpdate);
-            player.finished.connect(onEnded);
-            player.updateDuration.connect(onDuration);
-            player.error.connect(onError);
-            player.paused.connect(onPause);
+            if (!self._hasConnection) {
+                self._hasConnection = true;
+                player.playing.connect(onPlaying);
+                player.positionUpdate.connect(onTimeUpdate);
+                player.finished.connect(onEnded);
+                player.updateDuration.connect(onDuration);
+                player.error.connect(onError);
+                player.paused.connect(onPause);
+            }
 
             return setCurrentSrc(options);
         };
@@ -123,6 +127,7 @@ class mpvAudioPlayer {
             window.api.player.stop();
 
             const player = window.api.player;
+            self._hasConnection = false;
             player.playing.disconnect(onPlaying);
             player.positionUpdate.disconnect(onTimeUpdate);
             player.finished.disconnect(onEnded);

+ 14 - 6
native/mpvVideoPlayer.js

@@ -104,6 +104,10 @@
              * @type {float}
              */
             this._playRate = 1;
+            /**
+             * @type {boolean}
+             */
+            this._hasConnection = false;
 
             /**
              * @private
@@ -382,6 +386,7 @@
             document.body.classList.remove('hide-scroll');
 
             const player = window.api.player;
+            this._hasConnection = false;
             player.playing.disconnect(this.onPlaying);
             player.positionUpdate.disconnect(this.onTimeUpdate);
             player.finished.disconnect(this.onEnded);
@@ -433,12 +438,15 @@
                 document.body.insertBefore(dlg, document.body.firstChild);
                 this._videoDialog = dlg;
                 const player = window.api.player;
-                player.playing.connect(this.onPlaying);
-                player.positionUpdate.connect(this.onTimeUpdate);
-                player.finished.connect(this.onEnded);
-                player.updateDuration.connect(this.onDuration);
-                player.error.connect(this.onError);
-                player.paused.connect(this.onPause);
+                if (!this._hasConnection) {
+                    this._hasConnection = true;
+                    player.playing.connect(this.onPlaying);
+                    player.positionUpdate.connect(this.onTimeUpdate);
+                    player.finished.connect(this.onEnded);
+                    player.updateDuration.connect(this.onDuration);
+                    player.error.connect(this.onError);
+                    player.paused.connect(this.onPause);    
+                }
 
                 if (options.fullscreen) {
                     // At this point, we must hide the scrollbar placeholder, so it's not being displayed while the item is being loaded

+ 2 - 1
native/nativeshell.js

@@ -10,6 +10,7 @@ const features = [
     "clientsettings",
     "multiserver",
     "remotecontrol",
+    "fullscreenchange",
 ];
 
 const plugins = [
@@ -258,4 +259,4 @@ async function showSettingsModal() {
         modalContainer.remove();
     });
     closeContainer.appendChild(close);
-}
+}

+ 10 - 3
src/player/PlayerQuickItem.cpp

@@ -3,6 +3,7 @@
 #include <stdexcept>
 
 #include <QCoreApplication>
+#include <QGuiApplication>
 #include <QOpenGLContext>
 #include <QRunnable>
 
@@ -101,14 +102,20 @@ mpv_opengl_init_params opengl_params = {
 #endif
 };
 
+  const QString platformName = QGuiApplication::platformName();
+
   mpv_render_param params[] = {
     {MPV_RENDER_PARAM_API_TYPE, (void*)MPV_RENDER_API_TYPE_OPENGL},
     {MPV_RENDER_PARAM_OPENGL_INIT_PARAMS, &opengl_params},
-#ifdef USE_X11EXTRAS
-    {MPV_RENDER_PARAM_X11_DISPLAY, QX11Info::display()},
-#endif
+    {MPV_RENDER_PARAM_INVALID},
     {MPV_RENDER_PARAM_INVALID},
   };
+#ifdef USE_X11EXTRAS
+  if (platformName.contains("xcb")) {
+    params[2].type = MPV_RENDER_PARAM_X11_DISPLAY;
+    params[2].data = QX11Info::display();
+  }
+#endif
   int err = mpv_render_context_create(&m_mpvGL, m_mpv, params);
 
   if (err >= 0) {

+ 1 - 1
src/utils/Log.cpp

@@ -113,7 +113,7 @@ void Log::Init()
 
   qInstallMessageHandler(qtMessageOutput);
 
-  QLOG_INFO() << "Starting Plex Media Player version:" << qPrintable(Version::GetVersionString()) << "build date:" << qPrintable(Version::GetBuildDate());
+  QLOG_INFO() << "Starting Jellyfin Media Player version:" << qPrintable(Version::GetVersionString()) << "build date:" << qPrintable(Version::GetBuildDate());
   QLOG_INFO() << qPrintable(QString("  Running on: %1 [%2] arch %3").arg(QSysInfo::prettyProductName()).arg(QSysInfo::kernelVersion()).arg(QSysInfo::currentCpuArchitecture()));
   QLOG_INFO() << "  Qt Version:" << QT_VERSION_STR << qPrintable(QString("[%1]").arg(QSysInfo::buildAbi()));
 }