aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Player.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-03-04 00:06:52 +0300
committerRblSb <msrblsb@gmail.com>2020-03-04 00:10:09 +0300
commitf369250f8a20f926855e9d0d3d054632e322b987 (patch)
tree34790e7d1a73aa230f68cb75fcf3a2c44866675e /src/client/Player.hx
parent3c5e157371e623630c648a274386c11b7cae3586 (diff)
Iframe items
Diffstat (limited to 'src/client/Player.hx')
-rw-r--r--src/client/Player.hx10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/client/Player.hx b/src/client/Player.hx
index 443c14f..7088580 100644
--- a/src/client/Player.hx
+++ b/src/client/Player.hx
@@ -5,6 +5,7 @@ import js.Browser.document;
import client.Main.ge;
import client.players.Raw;
import client.players.Youtube;
+import client.players.Iframe;
import Types.VideoData;
import Types.VideoItem;
using StringTools;
@@ -93,7 +94,9 @@ class Player {
public function setVideo(i:Int):Void {
if (!main.isSyncActive) return;
final item = items[i];
- if (Youtube.isYoutube(item.url)) {
+ if (item.isIframe) {
+ setPlayer(new Iframe(main, this));
+ } else if (Youtube.isYoutube(item.url)) {
setPlayer(new Youtube(main, this));
} else {
setPlayer(new Raw(main, this));
@@ -156,12 +159,13 @@ class Player {
}
public function addVideoItem(item:VideoItem, atEnd:Bool):Void {
+ final url = item.url.htmlEscape(true);
final itemEl = nodeFromString(
'<li class="queue_entry pluid-0" title="${Lang.get("addedBy")}: ${item.author}">
- <a class="qe_title" href="${item.url}" target="_blank">${item.title.htmlEscape()}</a>
+ <a class="qe_title" href="$url" target="_blank">${item.title.htmlEscape()}</a>
<span class="qe_time">${duration(item.duration)}</span>
<div class="qe_clear"></div>
- <div class="btn-group" style="display: inline-block;">
+ <div class="btn-group">
<button class="btn btn-xs btn-default qbtn-play">
<span class="glyphicon glyphicon-play"></span>${Lang.get("play")}
</button>
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage