Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

How can I replace "stream not found" error with a picture

11 replies [Last post]
Reply

Hi,
As I mentioned in the title, How can I replace "stream not found" error with a picture oır another video. I dont want to see the "stream not found" error. When there is no video to stream, I want a picture or another video on screen.
Thanks for help...

Reply

There is an onError() event the player fires when this occurs. You can use this event to present a nicer error message. How to do this is up to you: you can load() a short "error" video in the player, you can place an error message on top of the player or you can replace the entire player with a formatted error message.

Reply

Do you have a simple example of what to add to the player code to accomplish this? My player code is below. What do I add?

<script type="text/javascript">
jwplayer('FlyPlayer').setup
({
'id': 'playerID',
'width': '640',
'height': '480',
'image': '../skin2/background.jpg',
'controlbar.position': 'over',
'modes':
[
{
type: 'flash',
src: '../JWPlayer58-L.swf',
config:
{
'provider': 'rtmp',
'streamer': 'rtmp://websitename.com/kris',
'file': 'idevice',
'skin': '../skin2/mute-only.swf',
'autostart': 'true'
}
},
{
type: 'html5',
config:
{
'provider': 'http',
'file': 'http://websitename.com/kris/idevice/playlist.m3u8'
}
}
]
});
</script>

Reply

You can add something like:

jwplayer('FlyPlayer').onError(function(error){
jwplayer('FlyPlayer').load("error.mp4");
});

This will load a video called "error.mp4" if an error occurs. Instead, you could also use javascript to remove the entire player and print a custom error message.

Reply

That works fine with Flash, but how about the HTML5 player?

Reply

The API works across Flash an HTML5

Reply

I changed the error code to display an image instead of an video. It works well and shows the image in a browser that shows Flash, but on iPad that uses the Html5 mode it doesn't show the image as the error message. It seems to attempt to do something when the error occurs, but it doesn't show the image that I specified. Any ideas for the code I posted above?

Reply

In HTML5, we do not support "playing" images. I think that's the issue.

It's very easy to create a video from an image with something like quicktime. Just open the image, then "select all" and "paste" a few times. You then copy the single image frame into multiple frames. Export as a small MP4 video and done.

Reply

Hi,

I also want to show an image instead of a error, can this be done within the embed code?
I dont have much code knowledge but this my code embed code if somebody can help;

<script type="text/javascript">
var so = new SWFObject("/player/jwplayer/player.swf","mpl","960","480","9");
so.addParam("allowscriptacces","always");
so.addParam("allowfullscreen","true");
so.addParam("flashvars","skin=/player/jwplayer/skin/skin2.zip&autostart=false&dock=false&provider=http&stretching=false&");
so.write("player");
</script>

Reply

Email me , I have a work around for this - http://www.longtailvideo.com/support/contact-us

Reply

Ok, have just send mail

Reply

Ok!

Post new comment

  • Allowed HTML tags: <code> <blockquote> <em> <strong> <strike> <ul> <li> <ol>
  • You may post code using <code>...</code> .
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options