diff options
Diffstat (limited to 'src/client/players')
| -rw-r--r-- | src/client/players/Raw.hx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/client/players/Raw.hx b/src/client/players/Raw.hx index dacf45c..57dd9b3 100644 --- a/src/client/players/Raw.hx +++ b/src/client/players/Raw.hx @@ -33,12 +33,16 @@ class Raw implements IPlayer { public function getVideoData(url:String, callback:(data:VideoData)->Void):Void { final decodedUrl = url.urlDecode(); var title = decodedUrl.substr(decodedUrl.lastIndexOf("/") + 1); - if (matchName.match(title)) title = matchName.matched(1); + final isNameMatched = matchName.match(title); + if (isNameMatched) title = matchName.matched(1); else title = Lang.get("rawVideo"); - final isHls = matchName.matched(2).contains("m3u8"); - if (isHls && !isHlsLoaded) { - loadHlsPlugin(() -> getVideoData(url, callback)); - return; + var isHls = false; + if (isNameMatched) { + isHls = matchName.matched(2).contains("m3u8"); + if (isHls && !isHlsLoaded) { + loadHlsPlugin(() -> getVideoData(url, callback)); + return; + } } final video = document.createVideoElement(); |
