Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

RTMP live stream playback seems to be broken after v4.8.1 #1722

Closed
thewatchers opened this issue Dec 7, 2014 · 7 comments
Closed

RTMP live stream playback seems to be broken after v4.8.1 #1722

thewatchers opened this issue Dec 7, 2014 · 7 comments

Comments

@thewatchers
Copy link

I've been struggling with a bug that I've narrowed down to video.js, and it seems to appear after release 4.8.1 from what I can tell (as that was the last version that worked for me.)

In the latest version (4.11.1), and at least one other (4.10.2) I was unable to get my RTMP stream to work at all with anything but the Safari browser (using HLS). But version video.js 4.8.1 (which I had been using up tell a few weeks ago) worked perfectly for viewing live relayed RTMP video streams (coming from an nginx based server) in Safari and Chrome (Mac and Windows).

I've just run several tests (on a closed internal network sorry to say) between the old and new versions, and it is definitely a problem that was introduced after video.js 4.8.1. The viewing web page is a very basic player, no special code or features, and hard coded RTMP paths. My sever does both direct replay of live RTMP stream and HLS.

Here's the viewer code I tested with. The only change was swapping out the video.js code on the server.

<head>
    <meta charset="utf-8">
    <link href="js/video-js/video-js.css" rel="stylesheet">
    <script src="js/video-js/video.js"></script>
    <script>
        videojs.options.flash.swf = "js/video-js/video-js.swf"
    </script>
    <style type="text/css">
      .vjs-default-skin { color: #ffffff; }
      .vjs-default-skin .vjs-control-bar { font-size: 103% }
    </style>
</head>
<body>
    <div class="main">
        <div id="content_area" class="well">
            <div class="vid_player">
                <video id="MY_VIDEO_1" class="video-js vjs-default-skin" controls
                 preload="auto" width="960" height="540" poster="images/POSTER.png"
                 data-setup="{}">
                 <source src="http://192.168.1.2/hls/4ktest.m3u8" type="application/x-mpegURL" />
                 <source src="rtmp://192.168.1.2/live/4ktest" type="rtmp/mp4">
                 <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
                </video>
            </div>
        </div>
    </div>
</body>

Also, I tried replacing the video-js.swf file (v4.4.3) in video.js 4.8.1 with the newer (v4.5.2) .swf file, and that works fine. So I know that the problem is not with the .swf player itself.

If someone can tell me what else I should look for I can provide more info, but right now there's nothing showing up on the console or in my server logs when it works with 4.8.1, or when it doesn't work with the newer versions like 4.11.1. So I'm not sure how else to troubleshoot the problem at this point.

@mmcc
Copy link
Member

mmcc commented Dec 8, 2014

Looks like the issue was actually introduced after 4.11. I can play back RTMP fine using 4.10, but I get a hanging player using 4.11, so the change was introduced in the 4.11.0 release. Just to make sure, I retraced your steps and tried to use the 4.10 swf, but, as you experienced, no luck.

My guess is that the Source Handler PR might be to blame here.

@rafaelgaspar
Copy link
Contributor

Also having this issue with 4.11.0 and 4.11.1, it was working fine with 4.10.1, and I just reverted it to 4.10.2 which also works.

@skalooza
Copy link

I've seen this as well. I grabbed the latest source code and built my own version and found out It has something to do with the minified code. The unminified code works fine. Hope this helps someone track it down.

@matteos
Copy link
Contributor

matteos commented Dec 18, 2014

I've narrowed down the bug.
It is indeed related to #1560 and also to minification (see also #1753).

The problem derives from the renaming of the methods

setRtmpConnection
setRtmpStream

inside flash.rtmp.js

Replacing the names in the minified version does fix the bug. I couldn't find a way to add those 2 methods to exports.js, maybe someone else will.

@skalooza
Copy link

changing the following in flash.rtmp.js:

tech.setRtmpConnection(srcParts.connection);  
tech.setRtmpStream(srcParts.stream); 

to

tech['setRtmpConnection'](srcParts.connection); 
tech['setRtmpStream'](srcParts.stream); 

fixed the minification issue for me.

@heff
Copy link
Member

heff commented Dec 19, 2014

The fix described here was added in #1755 and released in version 4.11.3. 169b498

@heff heff closed this as completed Dec 19, 2014
@tjenkinson
Copy link
Contributor

Great to hear as we were having the same issue. Thanks for fixing it!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

7 participants