YouTubeビデオを使用してビデオギャラリーを実装しようとしています。
これが今のところのコードです。
//html...
<div id="videogal" ></div>
//javascript
//initializing the gallery
//mplv is an array, getting data after a query in the db
//mplv[0] contains https://www.youtube.com/watch?v=hLgJjlFIxGA
document.getElementById("videogal").innerHTML='<object id="viewer" width="575" height="344"><embed src="' + mplv[0] + '" type="application/x-shockwave-flash" allowfullscreen="true" width="575" height="344"></embed></object>';
私はそれを働かせることができません。div
FF と IE と GC で得られるのは、YouTube ビデオがあるはずの空白だけです。
ここで何が欠けていますか?
前もって感謝します
編集
アダムが尋ねたように、より多くの情報とコード
ユーザーは、カスタムメイドの openlayers マップ内のポイントをクリックします。
//this activated when a point is clicked
function selected_feature(event){
//openlayers stuff here....
//query , and fill mplv[]
//simply call
videogaledit(0);
//0 is for initialize, like setting the first video
}
その後
function videogaledit(j) {
if (j==0){
alert('what is the link now '+mplv[0]);//works fine
document.getElementById("videogal").innerHTML='<object id="viewer" width="575" height="344"><embed src="' + mplv[0] + '" type="application/x-shockwave-flash" allowfullscreen="true" width="575" height="344"></embed></object>';
}
selected_feature(event)
内側init(){
にある から呼び出される<body onload='init();'>
videogaledit
外側にあるinit