From a5c0a40ee38e8e5ed17854e2b752c01f98a1d63f Mon Sep 17 00:00:00 2001 From: sevenrats Date: Mon, 30 Jan 2023 20:02:00 -0500 Subject: [PATCH 1/8] fix invalid ticks and video errorstate --- source/Main.brs | 6 +++++- source/VideoPlayer.brs | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/source/Main.brs b/source/Main.brs index 8c3b5831..5e679062 100644 --- a/source/Main.brs +++ b/source/Main.brs @@ -505,7 +505,11 @@ sub Main (args as dynamic) as void else if node.showID = invalid sceneManager.callFunc("popScene") else - autoPlayNextEpisode(node.id, node.showID) + if video.errorMsg = "" + autoPlayNextEpisode(node.id, node.showID) + else + sceneManager.callFunc("popScene") + end if end if end if else if type(msg) = "roDeviceInfoEvent" diff --git a/source/VideoPlayer.brs b/source/VideoPlayer.brs index 051fe47c..73bae24c 100644 --- a/source/VideoPlayer.brs +++ b/source/VideoPlayer.brs @@ -46,7 +46,11 @@ sub AddVideoContent(video, mediaSourceId, audio_stream_idx = 1, subtitle_idx = - end if if m.videotype = "Episode" or m.videotype = "Series" - video.runTime = (meta.json.RunTimeTicks / 10000000.0) + if isValid(meta.json.RunTimeTicks) + video.runTime = (meta.json.RunTimeTicks / 10000000.0) + else + video.runTime = invalid + end if video.content.contenttype = "episode" end if @@ -438,6 +442,7 @@ function getAudioInfo(meta as object) as object end function sub autoPlayNextEpisode(videoID as string, showID as string) + print "THIS CODE IS RUNNING NOW" ' use web client setting if m.user.Configuration.EnableNextEpisodeAutoPlay ' query API for next episode ID From 7783e7520e8121434bef1a0ef1c606105e5c7a95 Mon Sep 17 00:00:00 2001 From: sevenrats Date: Mon, 30 Jan 2023 20:07:51 -0500 Subject: [PATCH 2/8] dont put buttons on playback failure dialogs --- components/JFVideo.brs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/components/JFVideo.brs b/components/JFVideo.brs index a6fe67fc..88e6154f 100644 --- a/components/JFVideo.brs +++ b/components/JFVideo.brs @@ -114,9 +114,7 @@ sub onState(msg) ' If an error was encountered, Display dialog dialog = createObject("roSGNode", "Dialog") dialog.title = tr("Error During Playback") - dialog.buttons = [tr("OK")] dialog.message = tr("An error was encountered while playing this item.") - dialog.observeField("buttonSelected", "dialogClosed") m.top.getScene().dialog = dialog end if @@ -199,9 +197,7 @@ sub bufferCheck(msg) ' If buffering has stopped Display dialog dialog = createObject("roSGNode", "Dialog") dialog.title = tr("Error Retrieving Content") - dialog.buttons = [tr("OK")] dialog.message = tr("There was an error retrieving the data for this item from the server.") - dialog.observeField("buttonSelected", "dialogClosed") m.top.getScene().dialog = dialog ' Stop playback and exit player @@ -212,14 +208,6 @@ sub bufferCheck(msg) end sub -' -' Clean up on Dialog Closed -sub dialogClosed(msg) - sourceNode = msg.getRoSGNode() - sourceNode.unobserveField("buttonSelected") - sourceNode.close = true -end sub - function onKeyEvent(key as string, press as boolean) as boolean if key = "OK" and m.nextEpisodeButton.hasfocus() and not m.top.trickPlayBar.visible From c0561af6afc8a5cfdcf36ee592c8948de5a4411b Mon Sep 17 00:00:00 2001 From: sevenrats Date: Mon, 30 Jan 2023 20:24:31 -0500 Subject: [PATCH 3/8] remove debug prints --- source/VideoPlayer.brs | 1 - 1 file changed, 1 deletion(-) diff --git a/source/VideoPlayer.brs b/source/VideoPlayer.brs index 73bae24c..85a9d089 100644 --- a/source/VideoPlayer.brs +++ b/source/VideoPlayer.brs @@ -442,7 +442,6 @@ function getAudioInfo(meta as object) as object end function sub autoPlayNextEpisode(videoID as string, showID as string) - print "THIS CODE IS RUNNING NOW" ' use web client setting if m.user.Configuration.EnableNextEpisodeAutoPlay ' query API for next episode ID From 6e8f476b02b28feb0c59b80021c579a6f06ec8bd Mon Sep 17 00:00:00 2001 From: sevenrats Date: Wed, 1 Feb 2023 17:26:33 -0500 Subject: [PATCH 4/8] fix ok presses --- components/FailureDialog.xml | 22 ++++++++++++++++++++++ components/JFVideo.brs | 6 ++++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 components/FailureDialog.xml diff --git a/components/FailureDialog.xml b/components/FailureDialog.xml new file mode 100644 index 00000000..3f1a980e --- /dev/null +++ b/components/FailureDialog.xml @@ -0,0 +1,22 @@ + + + + + + + + + + \ No newline at end of file diff --git a/components/JFVideo.brs b/components/JFVideo.brs index 88e6154f..08244a38 100644 --- a/components/JFVideo.brs +++ b/components/JFVideo.brs @@ -112,8 +112,9 @@ sub onState(msg) m.top.retryWithTranscoding = true ' If playback was not reported, retry with transcoding else ' If an error was encountered, Display dialog - dialog = createObject("roSGNode", "Dialog") + dialog = createObject("roSGNode", "FailureDialog") dialog.title = tr("Error During Playback") + dialog.buttons = [tr("OK")] dialog.message = tr("An error was encountered while playing this item.") m.top.getScene().dialog = dialog end if @@ -195,8 +196,9 @@ sub bufferCheck(msg) m.top.callFunc("refresh") else ' If buffering has stopped Display dialog - dialog = createObject("roSGNode", "Dialog") + dialog = createObject("roSGNode", "FailureDialog") dialog.title = tr("Error Retrieving Content") + dialog.buttons = [tr("OK")] dialog.message = tr("There was an error retrieving the data for this item from the server.") m.top.getScene().dialog = dialog From 3a31cf7181384471e7fbf2d74e6413969d3d789c Mon Sep 17 00:00:00 2001 From: sevenrats Date: Wed, 1 Feb 2023 17:48:37 -0500 Subject: [PATCH 5/8] remove superfluous interface --- components/FailureDialog.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/components/FailureDialog.xml b/components/FailureDialog.xml index 3f1a980e..a3cb1ebd 100644 --- a/components/FailureDialog.xml +++ b/components/FailureDialog.xml @@ -2,10 +2,6 @@ - - - - +