aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/players/Raw.hx11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/client/players/Raw.hx b/src/client/players/Raw.hx
index fdb5e73..2b1530d 100644
--- a/src/client/players/Raw.hx
+++ b/src/client/players/Raw.hx
@@ -17,6 +17,7 @@ class Raw implements IPlayer {
final main:Main;
final player:Player;
final playerEl:Element = ge("#ytapiplayer");
+ final titleInput:InputElement = cast ge("#mediatitle");
final matchName = ~/^(.+)\.(.+)/;
var controlsHider:Timer;
var playAllowed = true;
@@ -36,7 +37,7 @@ class Raw implements IPlayer {
final url = data.url;
final decodedUrl = url.urlDecode();
- final optTitle = cutOptionalTitle();
+ final optTitle = titleInput.value.trim();
var title = decodedUrl.substr(decodedUrl.lastIndexOf("/") + 1);
final isNameMatched = matchName.match(title);
if (optTitle != "") title = optTitle;
@@ -51,6 +52,7 @@ class Raw implements IPlayer {
return;
}
+ titleInput.value = "";
final video = document.createVideoElement();
video.src = url;
video.onerror = e -> {
@@ -68,13 +70,6 @@ class Raw implements IPlayer {
if (isHls) initHlsSource(video, url);
}
- function cutOptionalTitle():String {
- final titleInput:InputElement = cast ge("#mediatitle");
- final optTitle = titleInput.value.trim();
- titleInput.value = "";
- return optTitle;
- }
-
function loadHlsPlugin(callback:()->Void):Void {
final url = "https://cdn.jsdelivr.net/npm/hls.js@latest";
JsApi.addScriptToHead(url, () -> {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage