Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to control the video play or pause by html5media? #61

Open
DevinCarl opened this issue Jun 5, 2015 · 2 comments
Open

how to control the video play or pause by html5media? #61

DevinCarl opened this issue Jun 5, 2015 · 2 comments

Comments

@DevinCarl
Copy link

I want to control the video to play or pause, and listen the event when finished playing.
how can I do these just by html5media?

is there any methods like html5media.play()?

@etianen
Copy link
Owner

etianen commented Jun 5, 2015

Unfortunately, because html5media will be implemented either using a flash player or the HTML5 MediaElement (depending on browser support), there’s no way to consistently call methods on the element.

html5media is designed to be small, fast and minimal. If you need this level of control, I’d look at a more advanced video player.

On 5 Jun 2015, at 09:44, Devin [email protected] wrote:

I want to control the video to play or pause, and listen the event when finished playing.
how can I do these just by html5media?

is there any methods like html5media.play()?


Reply to this email directly or view it on GitHub.

@fanfavorite
Copy link
Contributor

You can easily add controls as you need. Just need to create for both flowplayer and standard HTML5. I have used jQuery for the HTML5 example, but the events are available in plain javascript.

For on finish, you can do something like this:

Flowplayer:

html5media.configureFlowplayer = function(element, config) {        
    config.clip.onFinish = function(clip) {
        //do something when finished
    }           
    return config;
}

HTML5

$('video').on('ended',function(){
      //do something when finished
});

If you want to manually play videos:

Flowplayer:
$f('videoId').play();

HTML5:
$('#videoId').get(0).play();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants