diff options
| author | RblSb <msrblsb@gmail.com> | 2020-06-07 21:21:10 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2020-06-07 21:21:10 +0300 |
| commit | d6ffc5c839c18003695eaf08205e4399c20bb78e (patch) | |
| tree | 5567b08c333da8cfd0c9f3dcf285c6111c9a309d | |
| parent | d31f0b30481f6180e7907aee27413e5d208539aa (diff) | |
Hide iframes duration
| -rw-r--r-- | res/client.js | 12 | ||||
| -rw-r--r-- | src/client/Player.hx | 8 |
2 files changed, 16 insertions, 4 deletions
diff --git a/res/client.js b/res/client.js index 9bc4a2c..6b196b4 100644 --- a/res/client.js +++ b/res/client.js @@ -1879,7 +1879,8 @@ client_Player.prototype = { } ,addVideoItem: function(item,atEnd) { var url = StringTools.htmlEscape(item.url,true); - var itemEl = client_Utils.nodeFromString("<li class=\"queue_entry info\" title=\"" + Lang.get("addedBy") + ": " + item.author + "\">\n\t\t\t\t<header>\n\t\t\t\t\t<span class=\"qe_time\">" + this.duration(item.duration) + "</span>\n\t\t\t\t\t<h4><a class=\"qe_title\" href=\"" + url + "\" target=\"_blank\">" + StringTools.htmlEscape(item.title) + "</a></h4>\n\t\t\t\t</header>\n\t\t\t\t<span class=\"controls\">\n\t\t\t\t\t<button class=\"qbtn-play\" title=\"" + Lang.get("play") + "\"><ion-icon name=\"play\"></ion-icon></button>\n\t\t\t\t\t<button class=\"qbtn-next\" title=\"" + Lang.get("setNext") + "\"><ion-icon name=\"arrow-up\"></ion-icon></button>\n\t\t\t\t\t<button class=\"qbtn-tmp\"><ion-icon></ion-icon></button>\n\t\t\t\t\t<button class=\"qbtn-delete\" title=\"" + Lang.get("delete") + "\"><ion-icon name=\"close\"></ion-icon></button>\n\t\t\t\t</span>\n\t\t\t</li>"); + var duration = item.isIframe ? "" : this.duration(item.duration); + var itemEl = client_Utils.nodeFromString("<li class=\"queue_entry info\" title=\"" + Lang.get("addedBy") + ": " + item.author + "\">\n\t\t\t\t<header>\n\t\t\t\t\t<span class=\"qe_time\">" + duration + "</span>\n\t\t\t\t\t<h4><a class=\"qe_title\" href=\"" + url + "\" target=\"_blank\">" + StringTools.htmlEscape(item.title) + "</a></h4>\n\t\t\t\t</header>\n\t\t\t\t<span class=\"controls\">\n\t\t\t\t\t<button class=\"qbtn-play\" title=\"" + Lang.get("play") + "\"><ion-icon name=\"play\"></ion-icon></button>\n\t\t\t\t\t<button class=\"qbtn-next\" title=\"" + Lang.get("setNext") + "\"><ion-icon name=\"arrow-up\"></ion-icon></button>\n\t\t\t\t\t<button class=\"qbtn-tmp\"><ion-icon></ion-icon></button>\n\t\t\t\t\t<button class=\"qbtn-delete\" title=\"" + Lang.get("delete") + "\"><ion-icon name=\"close\"></ion-icon></button>\n\t\t\t\t</span>\n\t\t\t</li>"); VideoList.addItem(this.items,item,atEnd,this.itemPos); this.setItemElementType(itemEl,item.isTemp); if(atEnd) { @@ -2007,7 +2008,14 @@ client_Player.prototype = { var time = 0.0; var _g = 0; var _g1 = this.items; - while(_g < _g1.length) time += _g1[_g++].duration; + while(_g < _g1.length) { + var item = _g1[_g]; + ++_g; + if(item.isIframe) { + continue; + } + time += item.duration; + } return this.duration(time); } ,isListEmpty: function() { diff --git a/src/client/Player.hx b/src/client/Player.hx index 7de6d36..8fe42b3 100644 --- a/src/client/Player.hx +++ b/src/client/Player.hx @@ -209,10 +209,11 @@ class Player { public function addVideoItem(item:VideoItem, atEnd:Bool):Void { final url = item.url.htmlEscape(true); + final duration = item.isIframe ? "" : duration(item.duration); final itemEl = Utils.nodeFromString( '<li class="queue_entry info" title="${Lang.get("addedBy")}: ${item.author}"> <header> - <span class="qe_time">${duration(item.duration)}</span> + <span class="qe_time">$duration</span> <h4><a class="qe_title" href="$url" target="_blank">${item.title.htmlEscape()}</a></h4> </header> <span class="controls"> @@ -323,7 +324,10 @@ class Player { function totalDuration():String { var time = 0.0; - for (item in items) time += item.duration; + for (item in items) { + if (item.isIframe) continue; + time += item.duration; + } return duration(time); } |
