Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

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


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...

17 Community Answers

JeroenW

JW Player Support Agent  
0 rated :

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.

JW Player

User  
0 rated :

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>

JeroenW

JW Player Support Agent  
0 rated :

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.

JW Player

User  
0 rated :

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

JeroenW

JW Player Support Agent  
0 rated :

The API works across Flash an HTML5

JW Player

User  
0 rated :

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?

JeroenW

JW Player Support Agent  
0 rated :

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.

JW Player

User  
0 rated :

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>

Ethan Feldman

JW Player Support Agent  
-3 rated :

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

JW Player

User  
0 rated :

Ok, have just send mail

Ethan Feldman

JW Player Support Agent  
-2 rated :

Ok!

JW Player

User  
0 rated :

I'm trying to do this same thing. My code is as follows:


<script type='text/javascript'>
var so = new SWFObject('player.swf','mpl','640','360','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('file','test.flv');
so.addVariable('image','testing.jpg');
so.addVariable('streamer','rtmp://XXX-XXX-XXX-XX.compute-1.amazonaws.com:1935/live');
so.addVariable('stretching','exactfit');
so.addVariable('autostart','true');

so.write('mediaspace');
</script>

How would I need to modify my code to have an image display once the stream is turned off or not found?

Ethan Feldman

JW Player Support Agent  
-2 rated :

I replied to your email about this.

JW Player

User  
0 rated :

I also need to replace the Stream Not Found message to a picture or another text message... How can i get this?!

Ethan Feldman

JW Player Support Agent  
-2 rated :

I replied to your email.

JW Player

User  
0 rated :

Hi Can you please help me with the where to insert the error code

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

player code (kris post)
<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>

Ethan Feldman

JW Player Support Agent  
-2 rated :

What code…?

This question has received the maximum number of answers.