本文介绍了如何使用自定义按钮处理jwplayer播放器动作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了"JW-Player-5.2-Pro",我的文件如图所示.那里没有"jwplayer.js"文件,因此不能使用javascript api. "video.flv"嵌入为"readme.html",格式为:

I downloaded 'JW-Player-5.2-Pro' and my files are shown in the picture. theres no 'jwplayer.js' file there so can't use javascript api. 'video.flv' is embeded on 'readme.html' as:

<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="400" height="315">
    <param name="movie" value="player.swf" />
    <param name="allowfullscreen" value="true" />
    <param name="allowscriptaccess" value="always" />
    <param name="flashvars" value="file=video.flv&image=preview.jpg" />
    <embed
        type="application/x-shockwave-flash"![enter image description here][1]
        id="player2"
        name="player2"
        src="player.swf" 
        width="400" 
        height="315"
        allowscriptaccess="always" 
        allowfullscreen="true"
        flashvars="file=video.flv&image=preview.jpg" 
    />
</object>

但是我想通过自定义按钮来处理玩家的动作.我该怎么办?

but I want to handle the player actions by custom buttons. how can I do that ?

-谢谢.

推荐答案

您可以根据 jwplayer网站

因此,如果您的html类似于

so if your html is something like

<button id="play">play </button>

然后,您可以使用类似这样的javascript(使用jQuery进行说明).

then you can use some javascript like this (illustrating using jQuery).

$(document).ready(function(){
    $("#play").click(function(){
        jwplayer().load([{file:"/assets/myVideo.mp4"}]);
    }); 
});

这篇关于如何使用自定义按钮处理jwplayer播放器动作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 14:24