如何在jwplayer中删除全屏按钮?

时间:2012-07-11 14:34:13

标签: javascript fullscreen jwplayer

我需要删除jwplayer中的fullscreen按钮。我需要做什么?

代码

<object type="application/x-shockwave-flash" data="js/jwplayer/player.swf" width="100%" height="300" id="Player" name="Player">
<param name="allowfullscreen" value="true">
<param name="allowscriptaccess" value="always">
<param name="wmode" value="transaparent">
<param name="flashvars" value="file=http://www.youtube.com/watch?v='+id+'&autostart=true&playlist=over&dock=true&repeat=list">
</object>

2 个答案:

答案 0 :(得分:1)

我找到了一个简单的解决方案。从GitHub仓库下载Jwplayer的源代码(当然使用与你正在使用的版本相同的版本):

https://github.com/jwplayer/jwplayer/releases

assets/中必须有一个名为six.xml的文件(默认皮肤)。删除以下行:

<element name="fullscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAYAAAB75n/uAAAAbElEQVR42u2R0QnAIAxEu1lWc5/+ZYKs4TTWjwS0qIFrP+/BkYMLOdCLELKn1tpG5TleYF2yyMUzvCAOZDtwgU85PJGE/+NPyuTJG1Uts/9+sI0+y6GCrtunLHKJHbjAZYcd8x28IJTmhJAtD4gEt9ueDIktAAAAAElFTkSuQmCC"/>
<element name="fullscreenButtonOver" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAYAAAB75n/uAAACFUlEQVR42t2W324SURCHhS67VCoFbYhRkbQsaCwVSwgUaZP2yia9Mb6MN41vYfpIfYIm5QIegJfA3yTfSU52c1i98KabfGGYmd+cPX+Gw7On+2w2m5JPUfxfC5dhB8pQKooXvjGCiohFFRJ8EVTwVSHGtxOckSuOsCb2xUsDe0/swl42jiZxg2wr/kK0REf0DOzX4hXIzsVbaPODsH4VUSOxL8biwsD+SCEhOx/vo61Rq5zd1JipdhBkn6k4hmk2iKZDjdhtuj9Awnqm4twTPopf4lKM4BLfo0tCk1IjCQ3QFF0xR+QK/BBXYgxX+PycOdpmaAC3RG1xiui7uMWeic8ww3dLzgZNO7tEoU1OxYhpX7Dmd+KDgT0ldk5umt/k/DGtioZ4y/E7EUMx4JQcQR/fkJwemgY1OKbhAd6wnscU+ESRQ+jhOyGniyY4QFlE4rk4sCKIJyzFaLVa/XaNhT0iNiH30LTUiEJ9UGeqg8ViYRv3TVxjj80PY3zXloM9QFvf1gcN3mRiIr3pvX2u1+ufHMMvMDefn2MatI2iPjgSZyYylsvlg77fiK/umGLfWMzlmQbt3/UBQoc7530IxLf3QeT3AYIZbzbE9w5SfGfknGb6IAr1Qez9XL8XXabdxtc0sNvEuuS20MZFd0LsXThNqOOrQg0fcS6cXPHiKzOB2L8yg3GKG4WXfoBSUfz//W15ss8fvEcYMYnLr+AAAAAASUVORK5CYII="/>

然后,当你调用JwPlayer时,在skin选项中插入修改过的皮肤的路径:

jwplayer("myElement").setup({
  file: "/upload/myVideo.mp4",
  skin: "your-modified-six.xml"
});

请注意,双击播放器仍会启用全屏。您也应该通过编辑jwplayer.js的源代码在代码上禁用它(不仅仅是前端)。搜索allowfullscreen,并将其设置为false。

答案 1 :(得分:0)

使用以下皮肤:

Simple Skin