1 parent
deeed05383
commit
e8fd7ee35d
13 files changed
+61
-27
No files matched your search
@@ -27,7 +27,8 @@
|
||||
id="thumbnail"
|
||||
width="100"
|
||||
height="100"
|
||||
translation="[2,2]" />
|
||||
translation="[2,2]"
|
||||
failedBitmapUri="pkg:/images/thumbnail-missing.jpg" />
|
||||
|
||||
<Label
|
||||
id="authorLabel"
|
||||
|
||||
@@ -4,11 +4,10 @@ function Init()
|
||||
end function
|
||||
|
||||
function UpdateMaskSize()
|
||||
width = m.top.poster.width
|
||||
height = m.top.poster.height
|
||||
width = m.top.width
|
||||
height = m.top.height
|
||||
|
||||
maskSize = [width * GetScaleFactor(), height * GetScaleFactor()]
|
||||
m.top.maskGroup.maskSize = maskSize
|
||||
m.top.maskSize = [width * GetScaleFactor(), height * GetScaleFactor()]
|
||||
end function
|
||||
|
||||
' MaskGroup component do not scale with with UI resolution
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<field id="loadStatus" type="string" alias="Poster.loadStatus" />
|
||||
|
||||
<field id="maskUri" type="uri" value="pkg:/images/circle-mask-500.png" alias="MaskGroup.maskuri" />
|
||||
<field id="maskSize" type="vector2d" alias="MaskGroup.maskSize" />
|
||||
</interface>
|
||||
<children>
|
||||
<MaskGroup
|
||||
|
||||
@@ -12,9 +12,12 @@ namespace DialogUtils
|
||||
dialog.title = title
|
||||
dialog.buttons = buttons
|
||||
if large
|
||||
deviceInfo = CreateObject("roDeviceInfo")
|
||||
displaySize = deviceInfo.GetDisplaySize()
|
||||
dialog.width = displaySize.w - 100
|
||||
if m._deviceDisplayWidth = invalid
|
||||
deviceInfo = CreateObject("roDeviceInfo")
|
||||
displaySize = deviceInfo.GetDisplaySize()
|
||||
m._deviceDisplayWidth = displaySize.w
|
||||
end if
|
||||
dialog.width = m._deviceDisplayWidth - 100
|
||||
end if
|
||||
m.top.getScene().dialog = dialog
|
||||
return dialog
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<script type="text/brightscript" uri="pkg:/source/utils/StringUtils.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/components/VideoPlayer/VideoUtils.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/utils/FocusManagement.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/components/Dialog/DialogUtils.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
|
||||
<children>
|
||||
<AppController id="AppController">
|
||||
|
||||
@@ -2,13 +2,15 @@ import "pkg:/source/utils/TimeUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
FindChildren()
|
||||
end function
|
||||
|
||||
function FindChildren()
|
||||
m.titleLabel = m.top.findNode("titleLabel")
|
||||
m.authorLabel = m.top.findNode("authorLabel")
|
||||
m.thumbnail = m.top.findNode("thumbnail")
|
||||
m.durationRect = m.top.FindNode("durationRect")
|
||||
m.durationLabel = m.top.FindNode("durationLabel")
|
||||
|
||||
m.thumbnail.failedBitmapUri = "pkg:/images/thumbnail-missing.jpg"
|
||||
end function
|
||||
|
||||
function OnContentSet() as void
|
||||
@@ -18,6 +20,10 @@ function OnContentSet() as void
|
||||
return
|
||||
end if
|
||||
|
||||
if m.titleLabel = invalid
|
||||
FindChildren()
|
||||
end if
|
||||
|
||||
m.titleLabel.text = content.title
|
||||
m.authorLabel.text = content.author
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
id="thumbnail"
|
||||
loadDisplayMode="scaleToZoom"
|
||||
width="190"
|
||||
height="106">
|
||||
height="106"
|
||||
failedBitmapUri="pkg:/images/thumbnail-missing.jpg">
|
||||
<Rectangle
|
||||
id="durationRect"
|
||||
width="60"
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
function Init()
|
||||
m.authorLabel = m.top.FindNode("authorLabel")
|
||||
m.subCountLabel = m.top.FindNode("subCountLabel")
|
||||
m.videoCountLabel = m.top.FindNode("videoCountLabel")
|
||||
m.thumbnail = m.top.FindNode("thumbnail")
|
||||
m.thumbnail.failedBitmapUri = "pkg:/images/thumbnail-missing.jpg"
|
||||
end function
|
||||
|
||||
function OnContentSet() as void
|
||||
content = m.top.itemContent
|
||||
|
||||
@@ -14,8 +6,8 @@ function OnContentSet() as void
|
||||
end if
|
||||
|
||||
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
|
||||
m.authorLabel.text = content._author
|
||||
m.subCountLabel.text = content.subCountText
|
||||
m.videoCountLabel.text = content.videoCountText
|
||||
m.thumbnail.uri = content.thumbnail
|
||||
m.top._author = content._author
|
||||
m.top.subCountText = content.subCountText
|
||||
m.top.videoCountText = content.videoCountText
|
||||
m.top.thumbnail = content.thumbnail
|
||||
end function
|
||||
@@ -1,7 +1,11 @@
|
||||
<component name="ChannelRowCell" extends="Group">
|
||||
<interface>
|
||||
<field id="itemContent" type="node" onChange="OnContentSet" />
|
||||
<field id="type" type="string" value="channel" />
|
||||
<field id="_author" type="string" alias="authorLabel.text" />
|
||||
<field id="subCountText" type="string" alias="subCountLabel.text" />
|
||||
<field id="videoCountText" type="string" alias="videoCountLabel.text" />
|
||||
<field id="thumbnail" type="uri" alias="thumbnail.uri" />
|
||||
<field id="itemContent" type="node" onChange="OnContentSet" />
|
||||
</interface>
|
||||
<children>
|
||||
<LayoutGroup
|
||||
@@ -10,7 +14,8 @@
|
||||
<CirclePoster
|
||||
id="thumbnail"
|
||||
width="196"
|
||||
height="196" />
|
||||
height="196"
|
||||
failedBitmapUri="pkg:/images/thumbnail-missing.jpg" />
|
||||
|
||||
<Label
|
||||
id="authorLabel"
|
||||
|
||||
@@ -3,6 +3,10 @@ import "pkg:/source/utils/TimeUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
FindChildren()
|
||||
end function
|
||||
|
||||
function FindChildren()
|
||||
m.titleLabel = m.top.FindNode("titleLabel")
|
||||
m.authorLabel = m.top.FindNode("authorLabel")
|
||||
m.viewCountDateLabel = m.top.FindNode("viewCountDateLabel")
|
||||
@@ -11,7 +15,6 @@ function Init()
|
||||
m.durationRect = m.top.FindNode("durationRect")
|
||||
m.durationLabel = m.top.FindNode("durationLabel")
|
||||
m.thumbnail = m.top.FindNode("thumbnail")
|
||||
m.thumbnail.failedBitmapUri = "pkg:/images/thumbnail-missing.jpg"
|
||||
end function
|
||||
|
||||
function OnContentSet() as void
|
||||
@@ -21,6 +24,10 @@ function OnContentSet() as void
|
||||
return
|
||||
end if
|
||||
|
||||
if m.titleLabel = invalid
|
||||
FindChildren()
|
||||
end if
|
||||
|
||||
m.titleLabel.text = content.title
|
||||
m.authorLabel.text = content.author
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
id="thumbnail"
|
||||
loadDisplayMode="scaleToZoom"
|
||||
width="350"
|
||||
height="196">
|
||||
height="196"
|
||||
failedBitmapUri="pkg:/images/thumbnail-missing.jpg">
|
||||
<Rectangle
|
||||
id="durationRect"
|
||||
width="60"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||
import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
|
||||
@@ -6,6 +7,17 @@ namespace VideoUtils
|
||||
CloseVideo(false)
|
||||
|
||||
container = GetVideoContainer()
|
||||
' There should be no reason for this to be invalid, but there was a crash report
|
||||
' with this being invalid, so we'll abort playing a video and try to restore focus to the top screen
|
||||
if container = invalid
|
||||
LogError("VideoContainer not found! Attempting to restore focus to top screen...")
|
||||
appController = m.top.getScene().findNode("AppController")
|
||||
if appController <> invalid
|
||||
appController@.FocusTopScreen(invalid)
|
||||
end if
|
||||
DialogUtils.ShowDialog(`VideoContainer not found!\nPlease try again. If the problem persist, contact Playlet authors.`, "Error playing video")
|
||||
return
|
||||
end if
|
||||
videoPlayer = container.createChild("videoPlayer")
|
||||
videoPlayer.id = "VideoPlayer"
|
||||
videoPlayer@.BindNode(invalid)
|
||||
|
||||
Reference in new issue
Block a user