Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

RTMP Support Updates #687

Closed
wants to merge 5 commits into from
Closed

RTMP Support Updates #687

wants to merge 5 commits into from

Conversation

tomjohnson916
Copy link
Contributor

  • Updated Flash.js to include rtmpStream, rtmpConnection in api.readWrite
  • Updated Flash.js to replace double quote usage with single quote to validate under jsHint.
  • Tested with multiple SWFs (one including IProvider.die() SWF) and RTMP streams.

@bdeitte
Copy link
Contributor

bdeitte commented Aug 14, 2013

Looks good to me Tom- nice to see this tied up.

Note that if this is accepted, the following two pull requests can be closed as they contain a subset of this request: #634 and #605

@heff
Copy link
Member

heff commented Aug 15, 2013

@iamjem @bdeitte Would either of you guys be willing to write up a quick guide on using RTMP that I could put out there along with the new version?

@iamjem
Copy link
Contributor

iamjem commented Aug 16, 2013

I can probably do this before the end of the weekend, possibly even tomorrow. I did remove the extra "ugly" code in the flash.js onEvent method, and its updated in my 559-rtmp-support branch. It doesn't appear to be necessary anymore. I can make the docs addition in this same branch of mine if thats easiest? Or should I merge it all into my master?

@iamjem
Copy link
Contributor

iamjem commented Aug 16, 2013

I've added streaming details in the tech.md file in my 559-rtmp-support branch now.

@heff
Copy link
Member

heff commented Aug 16, 2013

Awesome, thanks!

@heff
Copy link
Member

heff commented Aug 16, 2013

@seniorflexdeveloper I pulled down the branch locally and I can't seem to get an rtmp stream to play.

My source looks like this.

<source src="rtmp://cp67126.edgefcs.net/ondemand/mp4&mediapm/ovp/content/test/video/spacealonehd_sounas_640_300.mp4" type='rtmp/mp4'>

Does that work for you?

@tomjohnson916
Copy link
Contributor Author

Looking now to see why that doesn't work. I was using the JS programmable route, i.e. on player.ready

player.src({ type: "rtmp/mp4",
src: "rtmp://cp88098.edgefcs.net/ondemand/&mp4:media/29906152001/29906152001_2538182935001_oceans-clip.mp4"
});

@bdeitte
Copy link
Contributor

bdeitte commented Aug 19, 2013

I suggest trying this on the iamjem:559-rtmp-support branch. That has the most RTMP changes right now, so it should be the branch that is pulled in.

@tomjohnson916
Copy link
Contributor Author

The stream URL @heff is using 404s in the Akamai Support Player. The URL should be; rtmp://cp67126.edgefcs.net/ondemand/mp4:mediapm/ovp/content/test/video/spacealonehd_sounas_640_300.mp4. Double checking now.

@tomjohnson916
Copy link
Contributor Author

As an update to my previous comment, the correct value including the ampersand delineator is as follows. This works in a sandbox implementation of this PR.

@iamjem
Copy link
Contributor

iamjem commented Aug 20, 2013

I've noticed two new problems after testing the RTMP updates with the most recent SWF from video-js-swf. Browser doesn't matter, just so long as you're using Flash playback with RTMP:

  1. Clicking on the flash object triggers play/pause twice. So if a video is playing, you click inside the video, playback pauses and resumes immediately. If its paused and you click inside of it, it plays then pauses immediately. Probably some event firing twice.
  2. When playback is paused, and you click on the progress bar, the flash seems to seek to the new point in the video BUT the progress bar doesn't update accordingly. Often times the flash object shows a frame from a totally different timecode. However, when you resume playback the flash seems to begin in the correct place, and the progress bar snaps back to where it needs to be.

@tomjohnson916
Copy link
Contributor Author

@iamjem - I can confirm seeing that bug in Chrome, but not in Safari or Firefox (all on Flash Player version 11.5.502).

@iamjem
Copy link
Contributor

iamjem commented Aug 20, 2013

Ah, it appears 1 is my own doing, I had some old onstageclick code in my dev branch, I've reset it and thats resolved now. 2 does still appear to happen though, I'll try to investigate some further.

@heff heff mentioned this pull request Aug 21, 2013
@iamjem
Copy link
Contributor

iamjem commented Aug 22, 2013

Ok, tracked down the problem. Seems Flash playback (doesn't matter if its progressive or streaming) has some problems reporting accurate times. Here's the two scenarios that exist:

  1. In the case of streaming, if you seek on the progress control while video is paused, the control will call currentTime() on the player to do the seek, and immediately ask for the time back to calculate the progress bar position. The RTMP provider doesn't report the new time until its finished seeking, so it always returns the old time.
  2. With progressive playback, while playback is paused, the progress bar will seek to the location of your click. Once you resume playback however, the progress control typically skips forward/backwards to adjust to where flash actually winds up seeking to. This is just a problem of progressive playback.

So, I enabled the seeking method on the Player class (it was already on both HTML5 and Flash tech, and enabled in the media API.. just wasn't "turned on" in the Player prototype). When a user seeks now, the progress control checks if the current tech is Flash and if its currently seeking.. if so it trys to use the cached lastCurrentTime value. Not the prettiest, but it fixes the problem.

This is in my 559-rtmp-support branch now.

@heff
Copy link
Member

heff commented Aug 22, 2013

Thanks for digging into that Jeremy.

We've got 3 (?) pull requests continuing for this. Can @seniorflexdeveloper or @bdeitte continue to pull everything together, or should I create a new branch in the main repo where I can immediately pull any changes into?

@bdeitte
Copy link
Contributor

bdeitte commented Aug 23, 2013

@heff the last time I checked, @iamjem has all changes from the other two pull requests in his branch

@tomjohnson916
Copy link
Contributor Author

@bdeitte is it the master branch? I will confirm later but looking at his flash.js file, it appears it's still missing the rtmpStream, rtmpConnectionUrl in the API readwrite.

https://github.com/videojs/video.js/blob/master/src/js/media/flash.js#L263

@bdeitte
Copy link
Contributor

bdeitte commented Aug 23, 2013

@seniorflexdeveloper no it's 559-rtmp-support

@iamjem
Copy link
Contributor

iamjem commented Aug 23, 2013

If my branch is the closest, and something is still missing, just let me know what else needs to be merged into it. I can add a test for the seeking method, seemed like there may be several other Player method tests that could be missing when I was cruising the tests before. Seeking will always return false from the "fake" test player though, so it may not be too valuable.

@tomjohnson916
Copy link
Contributor Author

@iamjem - https://github.com/iamjem/video.js/blob/559-rtmp-support/src/js/media/flash.js#L290 needs to include 'rtmpStream,rtmpConnection' and then I think you're set. For example, see tomjohnson916@dcc0b91#L0R293.

@iamjem
Copy link
Contributor

iamjem commented Aug 23, 2013

I've merged your master into the 559-rtmp-support, looks like it just included the items you mentioned, along with changing some double quotes to single, and removing white space. Pushed to github now.

@heff
Copy link
Member

heff commented Aug 23, 2013

Added through #605

@heff heff closed this Aug 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants