YouTube から動画を埋め込もうとしていましたが、YouTube のブランディングのためです。必要なパラメーターを追加した後でも、YouTube のブランディングは完全に隠されているわけではありません。そこから切り替えたいと思います。
ドロップボックスから mp4 動画を埋め込みたい。どうすればそれを進めることができますか?
以下は、YouTubeに使用した参照コードです。
youtubeLoadVideos : function () {
var videos = document.getElementsByClassName("youtube");
for (var i=0; i<videos.length; i++) {
var youtube = videos[i];
var iframe = document.createElement("iframe");
iframe.setAttribute("src", "http://www.youtube.com/embed/" + youtube.id + "?modestbranding=1&;showinfo=0&;autohide=1&;enablejsapi=1&;origin=http://www.youtube.com&;rel=0;");
iframe.style.width = youtube.style.width;
iframe.style.height = youtube.style.height;
iframe.style.clear = 'both';
youtube.parentNode.appendChild(iframe, youtube);
}
}
以下は私が疲れたものです:
new_video = document.createElement('video');
new_source = document.createElement('source');
final_video1 = document.getElementById('container').appendChild(new_video);
final_video1.setAttribute('id','sample');
final_video = document.getElementById('container').appendChild(new_video).appendChild(new_source);
final_video.setAttribute('src', 'https://dl.dropboxusercontent.com/u/87532981/Ella%20May%20and%20the%20Wishing%20Stone%20By%20Cary%20Fagan.mp4');
final_video.setAttribute('type', 'video/mp4;codecs="vp8, vorbis"');
$('#sample')[0].play();
このビデオでは、読み込みと再生が行われますが、再生ボタンも音量ボタンもありません。要するに、コントロールバーはありません。これには何ができますか?
最新の更新 2 :
new_video = document.createElement('video');
video = document.getElementById('RIZfC358yRk').appendChild(new_video);
source = document.createElement('source');
source.setAttribute('src','https://dl.dropboxusercontent.com/u/87532981/Ella%20May%20and%20the%20Wishing%20Stone%20By%20Cary%20Fagan.mp4');
video.appendChild(source);
video.play();
これでビデオを追加できますが、これにもコントロールバーがありません。再生ボタンがなく、進行状況バーもありません。一時停止ボタンもありません。どうすればそれらを追加できますか? 問題を見つけるのを手伝ってください。