Pergunta

I can't seem to figure out how to capture events with FlowPlayer. I'm loading the scripts from the CDN. Below is what I've attempted to try to catch the onFinish event, but no luck. Any help would be greatly appreciated.

<!DOCTYPE html>
<html>

<head>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <script src="//releases.flowplayer.org/5.4.3/flowplayer.min.js"></script>
    <link rel="stylesheet" href="//releases.flowplayer.org/5.4.3/skin/minimalist.css">

    <script>
         flowplayer("flowplayer", "video.flv", {
             onFinish: function () {
                 alert("Click Player to start video again");
                 }
             });
    </script>

    <title>FlowPlayer Test</title>
</head>

<body>
    <div class="flowplayer">
        <video>
            <source type="video/flv" src="video.flv">
        </video>
        </div>
</body>

</html>
Foi útil?

Solução

From your example code it looks like you are using the flowplayer HTML5 video player. As far as I am aware there is no onFinish event. There is however a finish event which you can bind to. Here's how:

Example

flowplayer(function (api, root) { 
    api.bind("finish", function () { 
        alert("Click Player to start video again"); 
    });

});

More information can be found on the flowplayer API docs

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top