简体   繁体   中英

onError Event is not working in Jwplayer?

I am using JWPlayer(licensed version). But If Flash player is not installed it gives the error

"Error loading player: No playable sources found"** .

When above error is displayed, i have to show alert message using JavaScript for that i had used onError event but its not working.

Below is the code which work fine except onError event.

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',
        events: {
                  onError:function({alert('Error');},
                  onComplete: function()  {document.getElementById('vid').style.display="none" ;}

        }
    });

JW Player does not yet expose "Setup" errors like this one. The onError() event does include all "Media" errors.

Setup errors need to be caught differently, since at that point the JavaScript API itself is actually not yet available. The task for adding this can be tracked here:

http://developer.longtailvideo.com/trac/ticket/1450

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