简体   繁体   English

JWPlayer:加载视频后开始播放

[英]JWPlayer: Start playing video after it loaded

I need to show a video in a site automatically, but the customer wants it to be shown only after it starts playing. 我需要在网站上自动显示视频,但是客户希望仅在开始播放后才显示视频。 Is this possible? 这可能吗?

To explain this better, on document.ready I have the player.swf opening and then it starts playing the video. 为了更好地说明这一点,请在document.ready上打开player.swf,然后开始播放视频。 However, before showing the actual video, there are 2 or 3 seconds of buffering while the video loads and then it starts playing. 但是,在显示实际视频之前,在视频加载期间有2到3秒钟的缓冲时间,然后才开始播放。 How can I avoid showing these buffering seconds to the user? 如何避免向用户显示这些缓冲秒数? This way, when the box that plays the video opens it does with the video starting, with no buffering or loading wheels. 这样,当播放视频的框打开时,它会在没有缓冲或加载轮的情况下开始播放视频。

Any ideas? 有任何想法吗?

You need to call jwplayer().play(); 您需要调用jwplayer().play();

After you setup player using jwplayer.setup() , just make a call to jwplayer().play(); 使用jwplayer.setup()设置播放器后,只需调用jwplayer().play(); and video should start playing. 视频应开始播放。

See the documentation for more. 有关更多信息,请参见文档

if you have not found answer yet than this might help 如果您尚未找到答案,那么可能会有所帮助

It is quite easy in setup just include 'autostart : true' 设置很简单,只需包含“ autostart:true”
I am using jwplayer 6 我正在使用jwplayer 6
Autostart 自动开启
Embedding jwplayer 嵌入jwplayer

<div id="myElement"></div>

<script>
    jwplayer("myElement").setup({
      file: "/uploads/myVideo.mp4",
      image: "/uploads/myPoster.jpg",
      autostart: true,
      mute: true
    });
</script>

And to avoid buffering in user end, you can have your own loader (buffering image) on Buffering...using 为了避免在用户端进行缓冲,您可以在Buffering ...上使用自己的加载程序(缓冲映像)

onBuffer() API in jwplayer .... so that user will understand that video is being loaded jwplayer中的onBuffer()API ....这样用户就可以了解正在加载视频

onBuffer(callback) onBuffer(回调)

Fired when the player enters the BUFFERING state. 当播放器进入BUFFERING状态时触发。 Event attributes: oldstate (String): the state the player moved from. 事件属性:oldstate(字符串):播放器从其移动的状态。 Can be IDLE, PLAYING or PAUSED. 可以是“空闲”,“正在播放”或“已暂停”。

Jwplayer onBuffer Jwplayer onBuffer

This is the comment issue i found when use JW flash player. 这是我在使用JW Flash Player时发现的注释问题。

I found one solution of it. 我找到了解决方案。

Open "player.xml" file in your wordpress plugin or JW Flash player config 在您的wordpress插件或JW Flash播放器配置中打开“ player.xml”文件

Set the smoothing flashvar to false. 将平滑flashvar设置为false。 Set the bufferlength flashvar to 1. 将bufferlength flashvar设置为1。

Have you tried seating the bufferlength flashvar to 0? 您是否尝试将bufferlength flashvar设置为0? http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12536/configuration-options http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12536/configuration-options

It's flash only and won't work with the html5 player. 它仅闪烁,不能与html5播放器一起使用。

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

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