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

Can't host jwplayer.js on server but only when Cloud Hosted


As a background, I can play a normal RTMP stream hosting both ways: i.e., hosting the jwplayer files on my server and also cloud hosted. (We have the Premium player edition.)

But, when I try to play an ABR "Stream Name Group" from Wowza it only works from the cloud player! Not from the server hosted jwplayer files.

Here's my html.

<!DOCTYPE html>
<html>
<head>
<title>My Video Feed</title>

<script type="text/javascript" src="jwplayer.js"/>
<script type="text/javascript">
jwplayer.key="my-key";
</script>

<!-- this works <script src="http://jwpsrv.com/library/my-key.js"></script> -->
</head>
<body>
<h2>Victory Video Feed</h2>
<div id="myElement">Loading the player...</div>

<script type="text/javascript">
jwplayer("myElement").setup({
width: 640,
height: 360,
image: 'Victory-1280-720.jpg',
file: 'http://172.16.101.8:1935/live/ngrp:myStream_all/playlist.m3u8',
primary: 'flash'
});
</script>

</body>
</html>

6 Community Answers

MisterNeutron

User  
1 rated :

While I don't think this is the problem, but you might as well get it right. This is not valid HTML5:

<script type="text/javascript" src="jwplayer.js"/>

The script tag is not self-closing. Change it to:

<script src="jwplayer.js"></script>

And in HTML5, you can leave out the "type" attribute - the default type for script is "text/javascript," so there's no need to specify it.

I'm also confused - you say you're using RTMP, but an M3U8 file is HLS, not RTMP. And why specify primary: 'flash'? The script will use Flash if it needs to, in any case.

Finally, do you have all three JW script files sitting together on your server?

alecosnet

User  
0 rated :

The JWplayer Key can be put inside the jwplayer.js just at the end of file... so nobody can copy your key...

Todd

JW Player Support Agent  
0 rated :

Is there any chance that your cloud-hosted player is a Premium license but the self-hosted key you are using is not? Please note that you must have a Premium key to enable the HLS playback of our player. What do you see listed as the JW Player version when you right-click on the player?

mark

User  
0 rated :

Just a heads up. I too have found this for many times when I tried it.,..... I think I know how CORS and Crossdomain works but for some reason the cloud library is not blocked when my own script is even when CORS is wide open. It only happens for HLS and I could never work out why. I gave up and no,I don't have a sample setup to show

painslie

User  
0 rated :

Thanks for jumping on this guys!! I solved it thanks to MisterNeutron's first tip on closing the tag properly. I changed
<script type="text/javascript" src="jwplayer.js"/>
to
<script src="jwplayer.js"></script>

MisterNeutron

User  
0 rated :

It's the little stuff that sneaks up and bites us.

This question has received the maximum number of answers.