試圖訪問我的視頻標籤的各種屬性。開始尋找HTML5視頻api的一些答案。使用api訪問html5視頻元素
這裏是我的基本代碼,我正在玩...
<body>
<div style="text-align:center">
<video id="video" onClick="cut()" src="test.mp4" autoplay="autoplay" >
not supported
</video>
</div>
<script type="text/javascript">
var myVideo=document.getElementById("video");
var currentClip=0;
document.write(myVideo.isEnabled); // trying to print this out to see what happens
function cut()
{
if (currentClip == 0){
myVideo.src = "bend.mp4"
currentClip = 1;
}
else{
myVideo.src = "test.mp4";
currentClip = 0;
}
}
function playPause(){
if (myVideo.paused){
myVideo.play();
}
else{
myVideo.pause();
}
}
function makeBig(){
myVideo.height=(myVideo.videoHeight*2);
}
function makeSmall(){
myVideo.height=(myVideo.videoHeight/2);
}
function makeNormal(){
myVideo.height=(myVideo.videoHeight);
}
</script>
我將嘗試使用該行 文件撰寫(myVideo.isEnabled); 但未定義。我已經在網絡編程方面提供過經驗,所以請原諒,如果有任何明顯的問題。
我似乎覺得我能做到這一點通過讀取API http://www.w3.org/TR/html5/video.html#media-resources-with-multiple-media-tracks
我想我只是真的不知道如何使用它的任何幫助,這部分款?