Add spinner

This commit is contained in:
Brahim Hadriche committed 2022-12-01 12:59:07 -05:00
1 parent b739742006
commit 58d2fc7041
5 files changed
+32 -13

No files matched your search

+1
View File
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support for web request body parsing
- Error dialog for video load fail
- SponsorBlock sections and category info
- Loading spinner
### Fixed
- Bug where playing and exiting a video too quickly would cause the video to play in the background.
@@ -0,0 +1,26 @@
function Init()
m.busySpinner = m.top.findNode("busySpinner")
m.busyspinner.poster.width = 150
m.busyspinner.poster.height = 150
m.busyspinner.poster.observeField("loadStatus", "PositionSpinner")
m.busySpinner.poster.uri = "pkg:/images/spinner.png"
m.top.observeField("visible", "OnVisibleChange")
end function
function PositionSpinner()
if m.busyspinner.poster.loadStatus = "ready"
centerx = (1280 - m.busyspinner.poster.width) / 2
centery = (720 - m.busyspinner.poster.height) / 2
m.busyspinner.translation = [centerx, centery]
m.busyspinner.visible = true
end if
end function
function OnVisibleChange()
m.busyspinner.visible = m.top.visible
if m.busyspinner.visible
m.busyspinner.control = "start"
else
m.busyspinner.control = "stop"
end if
end function
@@ -6,17 +6,11 @@
width="1280"
height="720"
color="#000000"
opacity="0.5"
>
<Label
text="Loading..."
width="1280"
height="720"
translation="[0, 0]"
horizAlign="center"
vertAlign="center"
font="font:MediumBoldSystemFont"
/>
opacity="0.5">
<BusySpinner
id="busySpinner"
inheritParentOpacity="false"
spinInterval="0.8" />
</Rectangle>
</children>
</component>
@@ -29,7 +29,6 @@
horizAlign="center"
vertAlign="center"
font="font:SmallestSystemFont"
inheritParentOpacity="true"
/>
</Rectangle>
<Rectangle
@@ -46,7 +45,6 @@
horizAlign="center"
vertAlign="center"
font="font:SmallestBoldSystemFont"
inheritParentOpacity="true"
text="LIVE"
/>
</Rectangle>
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB