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

RTMP Live stream doesn't load.


Hello, I am having nginx server running and trying to send stream to web via jwplayer but id simply display nothing .. the div is shown as height:0 .. i don't know it display nothing, can someone help me ?

<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="/jwplayer/jwplayer/jwplayer.js"></script>
<script>jwplayer.key="key was here"</script>
</head>
<body>
<div id="myElement"></div>
<script type="text/JavaScript">
var playerInstance = jwplayer("myElement");
playerInstance.setup({
file: "rtmp://127.0.0.1:2035/live",
image: "/jwplayer/assets/EducatIOLogo1.png",
height: 360,
width: 640,
rtmp: {
bufferlength: 0.1
}
});
</script>
</body>
</html>

9 Community Answers

Alex

JW Player Support Agent  
0 rated :

Hi there,

I do not see anything obviously wrong with your code, so we would need to see this player embed live to be able to see what the issue is. Can you please supply a link to a reproduction page so we can take a look at your issue?

Thank you.

Deyvid

User  
0 rated :

Ehm. thats the exact code ..
I mean what I expect is to see my live stream, captured by OBS (My screen) displayed on a JWPlayer, I'm just trying to do a sample live stream example and it doesn't work.
It's all localhosted for the stream I use nginx with rtmp module, for capture OBS ..

Alex

JW Player Support Agent  
0 rated :

Hi Deyvid,

I copy and pasted your HTML into a test file and with only the following changes:

  • Added a <html> tag to the top of the file
  • Changed your player’s relative URL to mine and added my license key
  • Changed your “file” URL to a RTMP stream that I know works

and the player appears just fine on the page for me.

Are you seeing any error messages in the browser’s console?

Thank you.

d...

User  
0 rated :

Ehm yes, it says:
video.html:5 GET file:///C:/jwplayer/jwplayer/jwplayer.js net::ERR_FILE_NOT_FOUND
video.html:6 Uncaught ReferenceError: jwplayer is not defined
at video.html:6
(anonymous) @ video.html:6
video.html:20 Uncaught SyntaxError: Unexpected identifier

The strange for video.html:5 Errror is that when I Ctrl+LeftButton in VSCode it opens the file correctly.
Also how at line
<script>jwplayer.key="key was here"</script>
player can not be defined ?
That's my errors, can you post your code, without your license key, and maybe give me any rtmp stream to try or whatever.. ? I am sure my stream works because I am currently testing it in https://www.wowza.com/testplayers .. Also what format should it be ?

playerInstance.setup({
file: "rtmp://127.0.0.1:2035/live/1234" is it good ?

Alex

JW Player Support Agent  
0 rated :

Hi Deivid,

I believe the issue is that you are not running a web server when testing locally. This is why the browser is resolving your relative path to jwplayer.js to file:///C:/jwplayer/jwplayer/jwplayer.js.

I would recommend using a local web server when testing on your computer. One recommendation is MAMP.

Thank you.

d...

User  
0 rated :

After I tried with the code you send me it still gives me errors:
video.html:4 GET file:///C:/jwplayer/jwplayer/jwplayer.js net::ERR_FILE_NOT_FOUND
video.html:5 Uncaught ReferenceError: jwplayer is not defined
at video.html:5
(anonymous) @ video.html:5
video.html:18 Uncaught ReferenceError: jwplayer is not defined
at video.html:18
(anonymous) @ video.html:18

How can I do it cloud Hosted if its the problem, also the folder nesting is as it follows:
jwp1 -> jwplayer
->assests
->jwplayer
-><all jwplayer fiels>
-> video.html

d...

User  
0 rated :

Oh can I test it on node.js ? Somehow ?

Alex

JW Player Support Agent  
0 rated :

HI Deivid,

Did you try using a local web server?

Alex

JW Player Support Agent  
0 rated :

Oh can I test it on node.js ? Somehow ?

You should be able to by running http-server or something similar.

This question has received the maximum number of answers.