From d6ffc5c839c18003695eaf08205e4399c20bb78e Mon Sep 17 00:00:00 2001 From: RblSb Date: Sun, 7 Jun 2020 21:21:10 +0300 Subject: Hide iframes duration --- res/client.js | 12 ++++++++++-- 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("
  • \n\t\t\t\t
    \n\t\t\t\t\t" + this.duration(item.duration) + "\n\t\t\t\t\t

    " + StringTools.htmlEscape(item.title) + "

    \n\t\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
  • "); + var duration = item.isIframe ? "" : this.duration(item.duration); + var itemEl = client_Utils.nodeFromString("
  • \n\t\t\t\t
    \n\t\t\t\t\t" + duration + "\n\t\t\t\t\t

    " + StringTools.htmlEscape(item.title) + "

    \n\t\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
  • "); 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( '
  • - ${duration(item.duration)} + $duration

    ${item.title.htmlEscape()}

    @@ -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); } -- cgit v1.2.3