diff options
| author | RblSb <msrblsb@gmail.com> | 2020-06-07 18:45:22 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2020-06-07 18:45:22 +0300 |
| commit | d31f0b30481f6180e7907aee27413e5d208539aa (patch) | |
| tree | ad1281ef9f5100bd05108dc42b8f5107f585444a /src/client/players/Raw.hx | |
| parent | f2567959538d7a7b26aa405353c2dbea4e6cc945 (diff) | |
Playlists "at next" order
Diffstat (limited to 'src/client/players/Raw.hx')
| -rw-r--r-- | src/client/players/Raw.hx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/client/players/Raw.hx b/src/client/players/Raw.hx index 57dd9b3..9a9d52e 100644 --- a/src/client/players/Raw.hx +++ b/src/client/players/Raw.hx @@ -6,6 +6,7 @@ import js.html.Element; import js.html.VideoElement; import js.Browser.document; import client.Main.ge; +import Types.VideoDataRequest; import Types.VideoData; import Types.VideoItem; using StringTools; @@ -30,7 +31,8 @@ class Raw implements IPlayer { return true; } - public function getVideoData(url:String, callback:(data:VideoData)->Void):Void { + public function getVideoData(data:VideoDataRequest, callback:(data:VideoData)->Void):Void { + final url = data.url; final decodedUrl = url.urlDecode(); var title = decodedUrl.substr(decodedUrl.lastIndexOf("/") + 1); final isNameMatched = matchName.match(title); @@ -40,7 +42,7 @@ class Raw implements IPlayer { if (isNameMatched) { isHls = matchName.matched(2).contains("m3u8"); if (isHls && !isHlsLoaded) { - loadHlsPlugin(() -> getVideoData(url, callback)); + loadHlsPlugin(() -> getVideoData(data, callback)); return; } } @@ -63,7 +65,8 @@ class Raw implements IPlayer { } function loadHlsPlugin(callback:()->Void):Void { - JsApi.addScriptToHead("https://cdn.jsdelivr.net/npm/hls.js@latest", () -> { + final url = "https://cdn.jsdelivr.net/npm/hls.js@latest"; + JsApi.addScriptToHead(url, () -> { isHlsLoaded = true; callback(); }); |
