视频播放结束后如何显示HTML?

时间:2010-03-30 18:02:00

标签: php jquery flowplayer jwplayer

我是新来的。

我想知道如何在视频播放完毕后显示HTML代码。我正在使用FlowPlayer(http://www.flowplayer.org)。

我尝试使用JW Flash Player(http://www.longtailvideo.com/players/jw-flv-player/)来实现这一目标,但无法弄清楚任何事情。

另外,如果可能,请告诉我。如果是,请与我和StackOverflow上的所有人分享。

P.S。我正在使用PHP。

4 个答案:

答案 0 :(得分:9)

根据FlowPlayer documentation,视频播放时会触发onFinish事件。虽然我刚刚更改了一些示例代码,但这样的代码应该可行:

flowplayer("player", "yourmoviefile.swf", {  

    // a clip object 
    clip: { 

        // a clip event is defined inside clip object 
        onFinish: function() { 
            $('#finish').html('your string to show here');
            alert("clip started"); 
        }  
    }
});

jQuery行将您指定的html字符串插入ID为finish的div。

答案 1 :(得分:1)

“显示HTML代码”是什么意思?一般来说,您必须使用javascript在客户端执行此操作,并将回调函数绑定到Flowplayer的onFinish剪辑事件。

答案 2 :(得分:0)

您可以将onFinish剪辑事件与flowplayer一起使用来触发您要显示的内容:

http://flowplayer.org/documentation/events/clip.html

根据您尝试显示的html,您可以使用“内容”Flash插件来显示它。它通常用于标题之类的内容。

http://flowplayer.org/plugins/flash/content.html

答案 3 :(得分:0)

好的人,我终于明白了,感谢所有回答的人。

以下是我与“内容”插件一起使用的代码。

    <div id="page">         
        <a href="flowplayer.flv"  
             style="display:block;width:520px;height:330px"  
             id="player"></a>           
        <script>                
            var player = flowplayer("player", "flowplayer-3.1.5.swf", {             
            plugins: {                  
                myContent: {                                        
                    url: 'flowplayer.content-3.1.0.swf',                                        
                    top: 20, 
                    width: 300,                     
                    borderRadius: 10,
                    display: 'none'                                             
                } 
            }               
            });             
            )               
            player.onFinish(function(clip) {
                var m=this.getPlugin("myContent");
                m.show();
                m.setHtml('You advertisement here. <b>This is bold text.</b> <i>This is italicized.</i>');
            });
        </script>       
    </div>

我希望这有助于某人。

相关问题