Commit ae4301aa authored by Ahoy's avatar Ahoy

start_time episode

parent 73db3e3e
Pipeline #12972680 passed with stages
in 46 seconds
......@@ -200,14 +200,14 @@
</div>
<div class="code">
<span class="comment">
Параметр <span class="attr-name">data-start_time</span> или <span class="attr-name">data-iframe_url</span>
Параметр <span class="attr-name">data-start_time</span> и <span class="attr-name">data-start_episode</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>
<span class="attr-name">data-start_episode=&quot;</span><span class="attr-value">ba547e283850a762|3|12</span><span class="attr-name">&quot;</span>
<span class="comment"> - с какой серии запустить видео token|сезон|серия</span>
</div>
<div class="code">
<span class="comment">
......
......@@ -160,9 +160,15 @@ function yo(sel) {
if (players.hasOwnProperty(key) && players[key]) {
if (key === 'moonwalk') {
if (options.iframe_url) {
players[key] = decodeURIComponent(options.iframe_url);
var reg = options.iframe_url.match(/^([a-z0-9]*?)\|([0-9]*?)\|([0-9]*?)$/i);
if (reg && reg.length === 4) {
players[key] = players[key].replace(/serial\/([a-z0-9]*?)\//i, 'serial/' + reg[1] + '/');
players[key] = (players[key].indexOf('?')+1)
? players[key] + '&season=' + reg[2] + '&episode=' + reg[3]
: players[key] + '?season=' + reg[2] + '&episode=' + reg[3]
}
}
else if (options.start_time) {
if (options.start_time) {
players[key] = (players[key].indexOf('?')+1)
? players[key] + '&start_time=' + options.start_time
: players[key] + '?start_time=' + options.start_time
......
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