From 45080aa1f6d80f2ef64983904acbe1645c312d25 Mon Sep 17 00:00:00 2001 From: RblSb Date: Sat, 23 May 2020 22:06:31 +0300 Subject: Improve history inputs --- src/client/players/Raw.hx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/client/players') 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(); -- cgit v1.2.3