aboutsummaryrefslogtreecommitdiffstats
path: root/src/Types.hx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Types.hx')
-rw-r--r--src/Types.hx21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/Types.hx b/src/Types.hx
index 1b1997a..1e59e82 100644
--- a/src/Types.hx
+++ b/src/Types.hx
@@ -6,6 +6,7 @@ enum abstract PlayerType(String) {
var RawType;
var YoutubeType;
var VkType;
+ var VimeoType;
var IframeType;
}
@@ -36,6 +37,7 @@ typedef ServerConfig = Config & {
localAdmins:Bool,
allowProxyIps:Bool,
localNetworkOnly:Bool,
+ enableCORS:Bool,
sslKeyPemPath:String,
sslCertPemPath:String,
cacheStorageLimitGiB:Float,
@@ -129,6 +131,7 @@ enum abstract ProgressType(String) {
var Downloading;
var Uploading;
var Canceled;
+ var Completed;
}
@:using(Types.VideoItemTools)
@@ -142,10 +145,17 @@ typedef VideoItem = {
var ?voiceOverTrack:String;
var isTemp:Bool;
var doCache:Bool;
+ var ?isIncomplete:Bool;
var playerType:PlayerType;
}
private class VideoItemTools {
+ public static function isPlayable(item:VideoItem):Bool {
+ // if item is uploading instead of caching, it's playable
+ if (item.isIncomplete == true && item.doCache) return false;
+ return true;
+ }
+
public static function withUrl(item:VideoItem, url:String):VideoItem {
return {
url: url,
@@ -156,6 +166,7 @@ private class VideoItemTools {
voiceOverTrack: item.voiceOverTrack,
isTemp: item.isTemp,
doCache: item.doCache,
+ isIncomplete: item.isIncomplete,
playerType: item.playerType
};
}
@@ -210,6 +221,7 @@ typedef WsEvent = {
?progress:{
type:ProgressType,
ratio:Float,
+ ?url:String,
?data:String
},
?updateClients:{
@@ -232,6 +244,11 @@ typedef WsEvent = {
?skipVideo:{
url:String
},
+ ?skipVideoStats:{
+ voted:Int,
+ total:Int,
+ required:Int
+ },
?pause:{
time:Float
},
@@ -258,7 +275,8 @@ typedef WsEvent = {
pos:Int
},
?toggleItemType:{
- pos:Int
+ pos:Int,
+ ?all:Bool
},
?updatePlaylist:{
videoList:Array<VideoItem>
@@ -287,6 +305,7 @@ enum abstract WsEventType(String) {
var AddVideo;
var RemoveVideo;
var SkipVideo;
+ var SkipVideoStats;
var VideoLoaded;
var Pause;
var Play;
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage