我正在附加一个对象元素。如何在IE中单击播放或暂停按钮时触发功能?
<object type="video/x-ms-wmv" data="test.wmv" width="340" height="280" id="movie1">
<param name="src" value="test.wmv" />
<param name="controller" value="false" />
<param name="autostart" value="true" />
</object>
我的js代码:
window.addEventListener('load', function () {
document.getElementById("movie1").addEventListener("click", onMovieStateChange, false);
});
function onMovieStateChange() {
var state = document.movie1.PlayState
if (state == 0) {
alert('video ended');
}
if (state == 1) {
alert('video paused');
}
alert('hi');
}