Search code examples
javascriptjqueryjwplayer

Video went to Idle state in jwplayer


I am using jwplayer for playing video:

jwplayer("container").setup({
    flashplayer: "<?php echo $this->getSkinUrl('video/mediaplayer/jwplayer.flash.swf') ?>",
    autostart: true,
    file: "<?php  echo $this->getSkinUrl('video/').$video ?>",
    type: 'mp4',
    controls: false,
    logo: {
        hide: true,
        position: 'top-left'
            
    },
    width: '432',
    height: '648',
    stretching: 'fill',
    screencolor: 'FFFFFF',
    fallback: false,
    events: {
        onIdle: function() {
            document.getElementById('vid').style.display="none";
        },
        onComplete: function() {
            document.getElementById('vid').style.display="none";
        }
    }
});

A video is playing, but in some browsers it went to Idle state and as a result user is not able to see video. How can I prevent video to go Idle state?


Solution

  • It's not possible to prevent the player from entering the IDLE state.

    If you want to display an image before video playback begins, you can include a configuration option image (see http://www.longtailvideo.com/support/jw-player/28839/embedding-the-player)

    From the "Configuration Options" section:

    image: URL to a JPG/PNG poster image to display before playback is started. For audio-only media, the poster image stays visible during playback.

    Note these options are used only for basic setups, like playing a single MP4 video or AAC song. Use the playlist option block for everything else, like an MP4+WebM source, SD+HD quality or a list with multiple clips. See Working with Playlists for more info.

    If the video goes idle during playback, the current video frame is shown, which is the behavior your users will expect, rather than going back to your specified image. When the video completes playback, it will automatically show the specified image again.