aboutsummaryrefslogtreecommitdiffstats
path: root/src/Types.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2024-04-29 07:45:10 +0300
committerRblSb <msrblsb@gmail.com>2024-04-29 07:45:10 +0300
commit5d2375cbb23dbe69a7afe7a691707be48397c6d9 (patch)
tree2fe92ab48e83427b3a7e90855545f73c2c8daa3e /src/Types.hx
parent9d844bbf3ac6be327325b13a91a6b33f73c49c1d (diff)
Video item fixes
- Fix youtube fallback, `videoItem.url` is now immutable - JsApi.setVideoSrc now updates to supported player based on `url` arg - Fix auto-pause when video is ended (with `requestLeaderOnPause`)
Diffstat (limited to 'src/Types.hx')
-rw-r--r--src/Types.hx30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/Types.hx b/src/Types.hx
index eeae641..27b2cce 100644
--- a/src/Types.hx
+++ b/src/Types.hx
@@ -98,14 +98,30 @@ typedef Message = {
time:String
}
+@:using(Types.VideoItemTools)
typedef VideoItem = {
- url:String,
- title:String,
- author:String,
- duration:Float,
- ?subs:String,
- isTemp:Bool,
- isIframe:Bool
+ /** Immutable, used as identifier for skipping / removing items **/
+ final url:String;
+ var title:String;
+ var author:String;
+ var duration:Float;
+ var ?subs:String;
+ var isTemp:Bool;
+ var isIframe:Bool;
+}
+
+private class VideoItemTools {
+ public static function withUrl(item:VideoItem, url:String):VideoItem {
+ return {
+ url: url,
+ title: item.title,
+ author: item.author,
+ duration: item.duration,
+ subs: item.subs,
+ isTemp: item.isTemp,
+ isIframe: item.isIframe
+ };
+ }
}
typedef FlashbackItem = {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage