简体   繁体   中英

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. However, before showing the actual video, there are 2 or 3 seconds of buffering while the video loads and then it starts playing. 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();

After you setup player using jwplayer.setup() , just make a call to 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'
I am using jwplayer 6
Autostart
Embedding 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

onBuffer() API in jwplayer .... so that user will understand that video is being loaded

onBuffer(callback)

Fired when the player enters the BUFFERING state. Event attributes: oldstate (String): the state the player moved from. Can be IDLE, PLAYING or PAUSED.

Jwplayer onBuffer

This is the comment issue i found when use JW flash player.

I found one solution of it.

Open "player.xml" file in your wordpress plugin or JW Flash player config

Set the smoothing flashvar to false. Set the bufferlength flashvar to 1.

Have you tried seating the bufferlength flashvar to 0? 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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