Điều khiển flash player sử dụng javascript


< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
< html xmlns="http://www.w3.org/1999/xhtml" lang="en" > < head >
< script type="text/javascript" src="swfobject.js" > < /script >
< script type="text/javascript" >
function sendEvent(swf,typ,prm) { thisMovie(swf).sendEvent(typ,prm); };

function getUpdate(typ,pr1,pr2,swf) {
if(typ == 'state') fetch_obj('stateshow').innerHTML = pr1;
};

function thisMovie(swf) {
if(navigator.appName.indexOf("Microsoft") != -1) return window[swf];
else return document[swf];
};

function fetch_obj(idname){
if (document.getElementById){
if(document.getElementById(idname)==null) return window.parent.document.getElementById(idname);
else return (document.getElementById(idname));
}else if (document.all){
if(document.all[idname]==null) return window.parent.document.all[idname];
else return document.all[idname];
}else if (document.layers){
if(document.layers[idname]==null ) return window.parent.document.layers[idname];
else return document.layers[idname];
}else return null;
};
< /script >
< body >
< div id="container" >
< embed type="application/x-shockwave-flash"
src="mediaplayer.swf"
id="jstest"
name="jstest"
quality="high"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="width=400&height=220&file=1.flv&javascriptid=jstest&enablejs=true"
height="220"
width="400" / >
< /div >

< ol >
< li > < a href="javascript:sendEvent('jstest','playpause');" > pause/resume the movie < /a > . < /li >
< li > < a href="javascript:sendEvent('jstest','stop');" > stop the movie < /a > . < /li >
< li > The current state is: < div id="stateshow" > < /div > (0=stop,1=buffer,2=play). < /li >
< /ol >

< /body >
< /html >

Nhận xét

Bài đăng phổ biến từ blog này

dung lượng RAM lớn nhất mà HĐH cấu trúc 32-bit nhận được

Ký tự viết tắt trong chat & email

Ubuntu LAMP Server