HTML5 video seeking

纵饮孤独 提交于 2019-11-28 18:25:32
longilong
seekToTime:function( value )
{
    var seekToTime = this.videoPlayer.currentTime + value;
    if( seekToTime < 0 || seekToTime > this.videoPlayer.duration ) 
        return;

    this.videoPlayer.currentTime = seekToTime;
}

This is the seek function we are using. It's in MooTools syntax, but you'll get the point. Hope it helps.

i guess you built your own controls with js and css?! well, therefore you have to extend your swf that you can call your seek function from javascript. external interface is your friend: in actionscript/flash:

 import flash.external.ExternalInterface; 

 ExternalInterface.addCallback( "methodName", this, method ); 

 function method() { trace("called from javascript"); }

call this via javascript

function callAS() {
    swf.methodName();
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!