简体   繁体   English

如何使用jPlayer切换背景图像占位符

[英]How to toggle a background image placeholder using jPlayer

I have a page on my site that uses jPlayer to play videos, simple stuff. 我的网站上有一个页面,使用jPlayer播放视频,简单的东西。 However i'm tasked with replacing the white/blank placeholder that appears before the video plays with our company logo in as fluid a fashion as possible. 但是我我任务是替换与本公司作为流体的方式尽可能的标志在视频播放前出现的白色/空白占位符。

I have seen the poster attribute in the jQuery but haven't been able to manage to make it look remotely tidy, the box resizes once the player starts. 我已经看到了jQuery海报属性,但一直没能设法使它看起来整洁远程,盒子大小调整一旦玩家开始。

Any insight would be much appreciated, even a pointer in the right direction 任何见解将不胜感激,即使是正确方向的指点

Thanks 谢谢

So you got it to work, but it doesn't look good? 这样您就可以使用它,但是看起来不太好吗? Can you load screenshots / provide an example of the code? 您可以加载屏幕截图/提供示例代码吗?

Here's an example how to specify a poster image to jPlayer: 以下是如何将海报图像指定给jPlayer的示例:

$(this).jPlayer("setMedia", {
  title: "Big Buck Bunny Trailer",
  m4v: "http://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v",
  ogv: "http://www.jplayer.org/video/ogv/Big_Buck_Bunny_Trailer.ogv",
  poster: "http://www.jplayer.org/video/poster/Big_Buck_Bunny_Trailer_480x270.png"
});

Also make sure the poster image is of the same ratio as your video (eg 16:9) 还要确保海报图像与视频的比例相同(例如16:9)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM