Commit cf1ea566 authored by Ahoy's avatar Ahoy

video tag

parent cf1d3335
Pipeline #31286932 passed with stages
in 47 seconds
......@@ -398,6 +398,29 @@
<span> </span>
<span class="attr-name">src=&quot;</span><span class="attr-value">//yohoho.cc/yo.js</span><span class="attr-name">&quot;</span><span class="tag">&gt;&lt;/script&gt;</span>
</div>
<h2>
<a href="#pleer_na_tege_video" id="pleer_na_tege_video" style="color: #fff">
Как показывать плеер на HTML5 теге <span class="tag">&lt;</span>video<span class="tag">&gt;</span>?
</a>
</h2>
Есть возможность открывать плеер на HTML5 теге <span class="tag">&lt;</span>video<span class="tag">&gt;</span>.
<div class="code">
<span class="tag">&lt;video</span>
<span> </span>
<span class="attr-name">id=&quot;</span><span class="attr-value">yohoho</span><span class="attr-name">&quot;</span>
<span> </span>
<span class="attr-name">data-kinopoisk=&quot;</span><span class="attr-value">401522</span><span class="attr-name">&quot;</span><span class="tag">&gt;</span>
<br>&nbsp;&nbsp;<span class="tag">&lt;source</span>
<span> </span>
<span class="attr-name">src=&quot;</span><span class="attr-value">//yohoho.cc/yo.mp4</span><span class="attr-name">&quot;</span>
<span> </span>
<span class="attr-name">type=&quot;</span><span class="attr-value">video/mp4</span><span class="attr-name">&quot;</span><span class="tag">&gt;</span>
<span class="tag">&lt;/video&gt;</span>
<br>
<span class="tag">&lt;script</span>
<span> </span>
<span class="attr-name">src=&quot;</span><span class="attr-value">//yohoho.cc/yo.js</span><span class="attr-name">&quot;</span><span class="tag">&gt;&lt;/script&gt;</span>
</div>
</div>
</div>
<div class="col-xs-6">
......
......@@ -17,7 +17,7 @@ function ahoy_yo() {
}
function yo(sel) {
var h, w, i, l, s, t = false, p = '';
var h, a, w, i, l, d, s, t = false, p = '';
var yohoho = document.querySelector('#' + ((sel) ? sel : 'yohoho'));
if (!yohoho) {
......@@ -115,7 +115,10 @@ function yo(sel) {
l = document.createElement('div');
l.setAttribute('id', 'yohoho-loading');
yohoho.innerHTML = '';
d = document.createElement('div');
var attr = Array.prototype.slice.call(yohoho.attributes);
while(a = attr.pop()) {d.setAttribute(a.nodeName, a.nodeValue);}
yohoho.parentNode.replaceChild(d, yohoho);
yohoho.appendChild(l);
i = document.createElement('iframe');
......
File added
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