mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-02-08 23:39:46 +01:00
youtube.js: display youtube video thumbnail in embeds
This commit is contained in:
parent
7280287695
commit
7b6e475bd0
@ -28,6 +28,7 @@ onReady(function() {
|
||||
|
||||
function addEmbedButton(index, videoNode) {
|
||||
videoNode = $(videoNode);
|
||||
let contents = videoNode.contents();
|
||||
let videoId = videoNode.data('video');
|
||||
let span = $("<span>[Embed]</span>");
|
||||
let embedNode = $('<iframe style="float:left;margin: 10px 20px" type="text/html" '+
|
||||
@ -35,9 +36,11 @@ onReady(function() {
|
||||
'?autoplay=1&html5=1" allowfullscreen frameborder="0"/>');
|
||||
span.click(function() {
|
||||
if (span.text() == ON){
|
||||
videoNode.append(contents);
|
||||
embedNode.remove();
|
||||
span.text(OFF);
|
||||
} else {
|
||||
contents.detach();
|
||||
videoNode.append(embedNode);
|
||||
span.text(ON);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user