mirror of
https://github.com/jellyfin/jellyfin-roku.git
synced 2024-11-23 06:09:41 +00:00
Merge pull request #2056 from jellyfin/2.2.z
This commit is contained in:
commit
e9deedf347
2
Makefile
2
Makefile
@ -3,7 +3,7 @@
|
|||||||
# If you want to get_images, you'll also need convert from ImageMagick
|
# If you want to get_images, you'll also need convert from ImageMagick
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
VERSION := 2.2.4
|
VERSION := 2.2.5
|
||||||
|
|
||||||
## usage
|
## usage
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@ sub loadItems()
|
|||||||
forceTranscoding = false
|
forceTranscoding = false
|
||||||
|
|
||||||
m.top.content = [LoadItems_VideoPlayer(id, mediaSourceId, audio_stream_idx, forceTranscoding)]
|
m.top.content = [LoadItems_VideoPlayer(id, mediaSourceId, audio_stream_idx, forceTranscoding)]
|
||||||
|
m.top.forceMp3 = false
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
function LoadItems_VideoPlayer(id as string, mediaSourceId = invalid as dynamic, audio_stream_idx = 1 as integer, forceTranscoding = false as boolean) as dynamic
|
function LoadItems_VideoPlayer(id as string, mediaSourceId = invalid as dynamic, audio_stream_idx = 1 as integer, forceTranscoding = false as boolean) as dynamic
|
||||||
@ -172,7 +173,7 @@ sub LoadItems_AddVideoContent(video as object, mediaSourceId as dynamic, audio_s
|
|||||||
if not isValid(mediaSourceId) then mediaSourceId = video.id
|
if not isValid(mediaSourceId) then mediaSourceId = video.id
|
||||||
if meta.live then mediaSourceId = ""
|
if meta.live then mediaSourceId = ""
|
||||||
|
|
||||||
m.playbackInfo = ItemPostPlaybackInfo(video.id, mediaSourceId, audio_stream_idx, subtitle_idx, playbackPosition)
|
m.playbackInfo = ItemPostPlaybackInfo(video.id, mediaSourceId, audio_stream_idx, subtitle_idx, playbackPosition, m.top.forceMp3)
|
||||||
if not isValid(m.playbackInfo)
|
if not isValid(m.playbackInfo)
|
||||||
video.errorMsg = "Error loading playback info"
|
video.errorMsg = "Error loading playback info"
|
||||||
video.content = invalid
|
video.content = invalid
|
||||||
@ -189,7 +190,7 @@ sub LoadItems_AddVideoContent(video as object, mediaSourceId as dynamic, audio_s
|
|||||||
video.SelectedSubtitle = defaultSubtitleIndex
|
video.SelectedSubtitle = defaultSubtitleIndex
|
||||||
subtitle_idx = defaultSubtitleIndex
|
subtitle_idx = defaultSubtitleIndex
|
||||||
|
|
||||||
m.playbackInfo = ItemPostPlaybackInfo(video.id, mediaSourceId, audio_stream_idx, subtitle_idx, playbackPosition)
|
m.playbackInfo = ItemPostPlaybackInfo(video.id, mediaSourceId, audio_stream_idx, subtitle_idx, playbackPosition, m.top.forceMp3)
|
||||||
if not isValid(m.playbackInfo)
|
if not isValid(m.playbackInfo)
|
||||||
video.errorMsg = "Error loading playback info"
|
video.errorMsg = "Error loading playback info"
|
||||||
video.content = invalid
|
video.content = invalid
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
<field id="studioIds" type="string" value="" />
|
<field id="studioIds" type="string" value="" />
|
||||||
<field id="genreIds" type="string" value="" />
|
<field id="genreIds" type="string" value="" />
|
||||||
<field id="view" type="string" value="" />
|
<field id="view" type="string" value="" />
|
||||||
|
<field id="forceMp3" type="boolean" value="false" />
|
||||||
<!-- Total records available from server-->
|
<!-- Total records available from server-->
|
||||||
<field id="totalRecordCount" type="int" value="-1" />
|
<field id="totalRecordCount" type="int" value="-1" />
|
||||||
<field id="content" type="array" />
|
<field id="content" type="array" />
|
||||||
|
@ -34,7 +34,6 @@ sub init()
|
|||||||
|
|
||||||
m.playbackTimer = m.top.findNode("playbackTimer")
|
m.playbackTimer = m.top.findNode("playbackTimer")
|
||||||
m.bufferCheckTimer = m.top.findNode("bufferCheckTimer")
|
m.bufferCheckTimer = m.top.findNode("bufferCheckTimer")
|
||||||
m.top.observeField("state", "onState")
|
|
||||||
m.top.observeField("content", "onContentChange")
|
m.top.observeField("content", "onContentChange")
|
||||||
m.top.observeField("selectedSubtitle", "onSubtitleChange")
|
m.top.observeField("selectedSubtitle", "onSubtitleChange")
|
||||||
m.top.observeField("audioIndex", "onAudioIndexChange")
|
m.top.observeField("audioIndex", "onAudioIndexChange")
|
||||||
@ -397,6 +396,8 @@ sub onVideoContentLoaded()
|
|||||||
return
|
return
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
m.top.observeField("state", "onState")
|
||||||
|
|
||||||
m.top.content = videoContent[0].content
|
m.top.content = videoContent[0].content
|
||||||
m.top.PlaySessionId = videoContent[0].PlaySessionId
|
m.top.PlaySessionId = videoContent[0].PlaySessionId
|
||||||
m.top.videoId = videoContent[0].id
|
m.top.videoId = videoContent[0].id
|
||||||
@ -639,6 +640,17 @@ sub onState(msg)
|
|||||||
|
|
||||||
if not m.playReported and m.top.transcodeAvailable
|
if not m.playReported and m.top.transcodeAvailable
|
||||||
m.top.retryWithTranscoding = true ' If playback was not reported, retry with transcoding
|
m.top.retryWithTranscoding = true ' If playback was not reported, retry with transcoding
|
||||||
|
else if m.top.errorStr = "decoder:pump:Unsupported AAC stream."
|
||||||
|
m.log.info("retrying video with mp3 audio stream", m.currentItem.id, m.top.SelectedSubtitle, m.top.audioIndex)
|
||||||
|
|
||||||
|
m.top.unobserveField("state")
|
||||||
|
m.LoadMetaDataTask.forceMp3 = true
|
||||||
|
m.LoadMetaDataTask.selectedSubtitleIndex = m.top.SelectedSubtitle
|
||||||
|
m.LoadMetaDataTask.selectedAudioStreamIndex = m.top.audioIndex
|
||||||
|
m.LoadMetaDataTask.itemId = m.currentItem.id
|
||||||
|
m.LoadMetaDataTask.observeField("content", "onVideoContentLoaded")
|
||||||
|
|
||||||
|
m.LoadMetaDataTask.control = "RUN"
|
||||||
else
|
else
|
||||||
' If an error was encountered, Display dialog
|
' If an error was encountered, Display dialog
|
||||||
showPlaybackErrorDialog(tr("Error During Playback"))
|
showPlaybackErrorDialog(tr("Error During Playback"))
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
<field id="retryWithTranscoding" type="boolean" value="false" />
|
<field id="retryWithTranscoding" type="boolean" value="false" />
|
||||||
<field id="isTranscoded" type="boolean" />
|
<field id="isTranscoded" type="boolean" />
|
||||||
<field id="transcodeReasons" type="array" />
|
<field id="transcodeReasons" type="array" />
|
||||||
|
<field id="forceMp3" type="boolean" value="false" />
|
||||||
|
|
||||||
<field id="videoId" type="string" />
|
<field id="videoId" type="string" />
|
||||||
<field id="mediaSourceId" type="string" />
|
<field id="mediaSourceId" type="string" />
|
||||||
|
2
manifest
2
manifest
@ -3,7 +3,7 @@
|
|||||||
title=Jellyfin
|
title=Jellyfin
|
||||||
major_version=2
|
major_version=2
|
||||||
minor_version=2
|
minor_version=2
|
||||||
build_version=4
|
build_version=5
|
||||||
|
|
||||||
### Main Menu Icons / Channel Poster Artwork
|
### Main Menu Icons / Channel Poster Artwork
|
||||||
|
|
||||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "jellyfin-roku",
|
"name": "jellyfin-roku",
|
||||||
"version": "2.2.4",
|
"version": "2.2.5",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "jellyfin-roku",
|
"name": "jellyfin-roku",
|
||||||
"version": "2.2.4",
|
"version": "2.2.5",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "GPL-2.0",
|
"license": "GPL-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jellyfin-roku",
|
"name": "jellyfin-roku",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "2.2.4",
|
"version": "2.2.5",
|
||||||
"description": "Roku app for Jellyfin media server",
|
"description": "Roku app for Jellyfin media server",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rokucommunity/bslib": "0.1.1",
|
"@rokucommunity/bslib": "0.1.1",
|
||||||
|
@ -13,7 +13,7 @@ function ItemGetPlaybackInfo(id as string, startTimeTicks = 0 as longinteger)
|
|||||||
return getJson(resp)
|
return getJson(resp)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function ItemPostPlaybackInfo(id as string, mediaSourceId = "" as string, audioTrackIndex = -1 as integer, subtitleTrackIndex = -1 as integer, startTimeTicks = 0 as longinteger)
|
function ItemPostPlaybackInfo(id as string, mediaSourceId = "" as string, audioTrackIndex = -1 as integer, subtitleTrackIndex = -1 as integer, startTimeTicks = 0 as longinteger, forceMp3 = false as boolean)
|
||||||
params = {
|
params = {
|
||||||
"UserId": m.global.session.user.id,
|
"UserId": m.global.session.user.id,
|
||||||
"StartTimeTicks": startTimeTicks,
|
"StartTimeTicks": startTimeTicks,
|
||||||
@ -49,24 +49,14 @@ function ItemPostPlaybackInfo(id as string, mediaSourceId = "" as string, audioT
|
|||||||
' TODO: Remove this after server adds support for transcoding AAC from one profile to another
|
' TODO: Remove this after server adds support for transcoding AAC from one profile to another
|
||||||
if selectedAudioStream.Codec <> invalid and LCase(selectedAudioStream.Codec) = "aac"
|
if selectedAudioStream.Codec <> invalid and LCase(selectedAudioStream.Codec) = "aac"
|
||||||
if selectedAudioStream.Profile <> invalid and LCase(selectedAudioStream.Profile) = "main" or LCase(selectedAudioStream.Profile) = "he-aac"
|
if selectedAudioStream.Profile <> invalid and LCase(selectedAudioStream.Profile) = "main" or LCase(selectedAudioStream.Profile) = "he-aac"
|
||||||
for each rule in deviceProfile.TranscodingProfiles
|
forceMp3 = true
|
||||||
if rule.Container = "ts" or rule.Container = "mp4"
|
|
||||||
if rule.AudioCodec = "aac"
|
|
||||||
rule.AudioCodec = "mp3"
|
|
||||||
else if rule.AudioCodec.Left(4) = "aac,"
|
|
||||||
rule.AudioCodec = mid(rule.AudioCodec, 5)
|
|
||||||
|
|
||||||
if rule.AudioCodec.Left(3) <> "mp3"
|
|
||||||
rule.AudioCodec = "mp3," + rule.AudioCodec
|
|
||||||
end if
|
|
||||||
end if
|
|
||||||
end if
|
|
||||||
end for
|
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
if forceMp3 then forceMp3Audio(deviceProfile)
|
||||||
|
|
||||||
req = APIRequest(Substitute("Items/{0}/PlaybackInfo", id), params)
|
req = APIRequest(Substitute("Items/{0}/PlaybackInfo", id), params)
|
||||||
req.SetRequest("POST")
|
req.SetRequest("POST")
|
||||||
return postJson(req, FormatJson({ "DeviceProfile": deviceProfile }))
|
return postJson(req, FormatJson({ "DeviceProfile": deviceProfile }))
|
||||||
@ -538,3 +528,20 @@ function TVEpisodeShuffleList(show_id as string)
|
|||||||
|
|
||||||
return data
|
return data
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
' updates the device profile we send the server to force mp3 audio transcoding instead of the default aac
|
||||||
|
sub forceMp3Audio(deviceProfile as object)
|
||||||
|
for each rule in deviceProfile.TranscodingProfiles
|
||||||
|
if rule.Container = "ts" or rule.Container = "mp4"
|
||||||
|
if rule.AudioCodec = "aac"
|
||||||
|
rule.AudioCodec = "mp3"
|
||||||
|
else if rule.AudioCodec.Left(4) = "aac,"
|
||||||
|
rule.AudioCodec = mid(rule.AudioCodec, 5)
|
||||||
|
|
||||||
|
if rule.AudioCodec.Left(3) <> "mp3"
|
||||||
|
rule.AudioCodec = "mp3," + rule.AudioCodec
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
end for
|
||||||
|
end sub
|
||||||
|
Loading…
Reference in New Issue
Block a user