Commit 73db3e3e authored by Ahoy's avatar Ahoy

start_time episode

parent 18811f8e
Pipeline #12969569 passed with stages
in 46 seconds
......@@ -200,11 +200,14 @@
</div>
<div class="code">
<span class="comment">
Параметр <span class="attr-name">data-start_time</span>
Параметр <span class="attr-name">data-start_time</span> или <span class="attr-name">data-iframe_url</span>
</span>
<br>
<span class="attr-name">data-start_time=&quot;</span><span class="attr-value">60</span><span class="attr-name">&quot;</span>
<span class="comment"> - с какой секунды запустить видео</span>
<br>
<span class="attr-name">data-iframe_url=&quot;</span><span class="attr-value">//streamguard.cc/serial/ba547e283850a762/iframe?season=3&episode=12&start_time=60</span><span class="attr-name">&quot;</span>
<span class="comment"> - с какой секунды запустить серию</span>
</div>
<div class="code">
<span class="comment">
......
......@@ -158,11 +158,16 @@ function yo(sel) {
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i].toLowerCase().trim();
if (players.hasOwnProperty(key) && players[key]) {
players[key] = (key === 'moonwalk' && options.start_time)
? (players[key].indexOf('?')+1)
? players[key] + '&start_time=' + options.start_time
: players[key] + '?start_time=' + options.start_time
: players[key];
if (key === 'moonwalk') {
if (options.iframe_url) {
players[key] = decodeURIComponent(options.iframe_url);
}
else if (options.start_time) {
players[key] = (players[key].indexOf('?')+1)
? players[key] + '&start_time=' + options.start_time
: players[key] + '?start_time=' + options.start_time
}
}
var option = document.createElement('div');
option.setAttribute('onclick', 'showPlayer("' + players[key] + '", this)');
option.dataset.iframe = players[key];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment