我如何调试自己的视频,因为目前没有出现警报。我用的是IE9,播放器是jwplayer。我是否遗漏了某些东西,或者我是否将用于调试的 javascript 代码放在了错误的位置,因为我试图将它放在 jwplayer 元素的下方和上方。我应该在单击播放时看到警报还是应该立即出现?
<div id="myElement">Loading the player...</div>
<?php echo 'This is the videoPath '.$dbVideoFile; ?>
<script type="text/javascript">
jwplayer("myElement").setup({
file: "<?php echo $dbVideoFile; ?>",
});
var myvid = document.getElementById('myElement');
if (myvid.error) {
switch (myvid.error.code) {
case MEDIA_ERR_ABORTED:
alert("You stopped the video.");
break;
case MEDIA_ERR_NETWORK:
alert("Network error - please try again later.");
break;
case MEDIA_ERR_DECODE:
alert("Video is broken..");
break;
case MEDIA_ERR_SRC_NOT_SUPPORTED:
alert("Sorry, your browser can't play this video.");
break;
}
}
</script>