diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e08108c..b772f502 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - User interface for the Queue: Press and hold `Options (*)` to show the queue +### Fixed + +- Crash when video player has no content +- Execution timeout on cirlce posters + ## [0.15.1] - 2023-11-10 ### Added diff --git a/playlet-lib/src/components/CirclePoster/CirclePoster.bs b/playlet-lib/src/components/CirclePoster/CirclePoster.bs index bd4333d7..893662c8 100644 --- a/playlet-lib/src/components/CirclePoster/CirclePoster.bs +++ b/playlet-lib/src/components/CirclePoster/CirclePoster.bs @@ -7,17 +7,27 @@ function UpdateMaskSize() width = m.top.width height = m.top.height - m.top.maskSize = [width * GetScaleFactor(), height * GetScaleFactor()] + m.top.maskSize = [width * GetUIScaleFactor(), height * GetUIScaleFactor()] end function ' MaskGroup component do not scale with with UI resolution -function GetScaleFactor() as float - if m.scaleFactor <> invalid - return m.scaleFactor +function GetUIScaleFactor() as float + if m.uiScaleFactor <> invalid + return m.uiScaleFactor end if + + if m.global.uiScaleFactor <> invalid + return m.global.uiScaleFactor + end if + deviceInfo = CreateObject("roDeviceInfo") uiResolutionWidth = deviceInfo.GetUIResolution().width ' divide by 1280 because we have ui_resolutions=hd in manifest - m.scaleFactor = uiResolutionWidth / 1280 - return m.scaleFactor + m.uiScaleFactor = uiResolutionWidth / 1280 + + if not m.global.hasField("uiScaleFactor") + m.global.addField("uiScaleFactor", "float", false) + end if + m.global.uiScaleFactor = m.uiScaleFactor + return m.uiScaleFactor end function diff --git a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs index 63fc3255..7e66cedc 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs @@ -185,8 +185,18 @@ function OnVideoPlayerStateChange() as void end if if state = "finished" + if content = invalid + m.container@.watchedVideosClear(invalid) + VideoUtils.CloseVideo() + end if + metadata = content.metadata - if metadata <> invalid and not PlayNext(metadata.recommendedVideos) + if metadata = invalid + m.container@.watchedVideosClear(invalid) + VideoUtils.CloseVideo() + end if + + if not PlayNext(metadata.recommendedVideos) m.container@.watchedVideosClear(invalid) VideoUtils.CloseVideo() end if