mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-05 18:22:46 +00:00
Added Direct Play and websocket improvements
* [backend]: Websocket now automatically tries to reconnect if connection was lost, up to 3 times. * [backend]: Move more playback and resume logic to the backend, to avoid having it in multiple places within the QML. Regression: pausing playback sometimes halts the video player for an unknown reason. * [playback]: Sailfin will try to play without the server transcoding, if possible. * [ui]: added a debug page in the settings
This commit is contained in:
parent
a244c27b1a
commit
7e77abc173
13 changed files with 204 additions and 45 deletions
|
@ -31,15 +31,15 @@ import "../"
|
|||
|
||||
SilicaItem {
|
||||
id: playerRoot
|
||||
property alias item : mediaSource.item
|
||||
property JellyfinItem item
|
||||
property string title: item.name
|
||||
property alias resume: mediaSource.resumePlayback
|
||||
property bool resume
|
||||
property int progress
|
||||
readonly property bool landscape: videoOutput.contentRect.width > videoOutput.contentRect.height
|
||||
property MediaPlayer player
|
||||
readonly property bool hudVisible: !hud.hidden || player.error !== MediaPlayer.NoError
|
||||
property alias audioTrack: mediaSource.audioIndex
|
||||
property alias subtitleTrack: mediaSource.subtitleIndex
|
||||
property int audioTrack: 0
|
||||
property int subtitleTrack: 0
|
||||
|
||||
// Blackground to prevent the ambience from leaking through
|
||||
Rectangle {
|
||||
|
@ -47,13 +47,6 @@ SilicaItem {
|
|||
color: Theme.overlayBackgroundColor
|
||||
}
|
||||
|
||||
PlaybackManager {
|
||||
id: mediaSource
|
||||
apiClient: ApiClient
|
||||
mediaPlayer: player
|
||||
autoOpen: true
|
||||
}
|
||||
|
||||
VideoOutput {
|
||||
id: videoOutput
|
||||
source: player
|
||||
|
@ -69,7 +62,8 @@ SilicaItem {
|
|||
Label {
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.horizontalPageMargin
|
||||
text: item.jellyfinId + "\n" + mediaSource.streamUrl + "\n"
|
||||
text: item.jellyfinId + "\n" + appWindow.playbackManager.streamUrl + "\n"
|
||||
+ (appWindow.playbackManager.playMethod == PlaybackManager.DirectPlay ? "Direct Play" : "Transcoding") + "\n"
|
||||
+ player.position + "\n"
|
||||
+ player.status + "\n"
|
||||
+ player.bufferProgress + "\n"
|
||||
|
@ -78,7 +72,7 @@ SilicaItem {
|
|||
+ player.errorString + "\n"
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
wrapMode: "WordWrap"
|
||||
visible: true
|
||||
visible: appWindow.showDebugInfo
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,6 +81,13 @@ SilicaItem {
|
|||
player: playerRoot.player
|
||||
}
|
||||
|
||||
function start() {
|
||||
appWindow.playbackManager.audioIndex = audioTrack
|
||||
appWindow.playbackManager.subtitleIndex = subtitleTrack
|
||||
appWindow.playbackManager.resumePlayback = resume
|
||||
appWindow.playbackManager.item = item
|
||||
}
|
||||
|
||||
function stop() {
|
||||
player.stop()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue