-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
added RTMP support. fixes #559 #605
Changes from 8 commits
c76e4c3
ae00d62
4803939
9f9c17a
dcc0b91
fced88f
12190f9
ed93590
8184d18
2045eb1
a5db6ba
372d395
ccfba30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,24 @@ When adding additional Tech to a video player, make sure to add the supported te | |
techOrder: ["html5", "flash", "other supported tech"] | ||
}); | ||
|
||
Flash Technology | ||
================== | ||
The flash playback tech is a part of the default `techOrder`. You may notice undesirable playback performance in browsers that are subject to using this playback tech, in particular when scrubbing and seeking within a video. These performance issues are a result of flash's progressive video playback. | ||
|
||
Enabling Streaming Playback | ||
-------------------------------- | ||
In order to force the flash tech to choose streaming playback, you need to provide a valid streaming source **before other valid flash video sources**. This is necessary because of the source selection algorithm, where playback tech chooses the first possible source object with a valid type. Valid streaming `type` values include `rtmp/mp4` and `rtmp/flv`. The streaming `src` value requires valid connection and stream strings, separated by an `&`. An example of supplying a streaming source through your HTML markup might look like: | ||
|
||
<source src="rtmp://your.streaming.provider.net/cfx/st/&mp4:path/to/video.mp4" type="rtmp/mp4"> | ||
<source src="http://your.static.provider.net/path/to/video.mp4" type="video/mp4"> | ||
<source src="http://your.static.provider.net/path/to/video.webm" type="video/webm"> | ||
|
||
You may optionally use the last `/` as the separator between connection and stream strings, for example: | ||
|
||
<source src="rtmp://your.streaming.provider.net/cfx/st/mp4:video.mp4" type="rtmp/mp4"> | ||
|
||
All four RTMP protocols are valid in the `src`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be nice to list the four for those who don't know. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've made these suggested updates now on github. On Sun, Aug 18, 2013 at 7:36 PM, Brian Deitte notifications@github.comwrote:
|
||
|
||
Youtube Technology | ||
================== | ||
To add a youtube source to your video tag, use the following source: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
module('Flash'); | ||
|
||
var streamToPartsAndBack = function(url) { | ||
var parts = vjs.Flash.streamToParts(url); | ||
return vjs.Flash.streamFromParts(parts.connection, parts.stream); | ||
}; | ||
|
||
test('test using both streamToParts and streamFromParts', function() { | ||
ok('rtmp://myurl.com/&isthis' === streamToPartsAndBack('rtmp://myurl.com/isthis')); | ||
ok('rtmp://myurl.com/&isthis' === streamToPartsAndBack('rtmp://myurl.com/&isthis')); | ||
ok('rtmp://myurl.com/isthis/&andthis' === streamToPartsAndBack('rtmp://myurl.com/isthis/andthis')); | ||
}); | ||
|
||
test('test streamToParts', function() { | ||
var parts = vjs.Flash.streamToParts('http://myurl.com/streaming&/is/fun'); | ||
ok(parts.connection === 'http://myurl.com/streaming'); | ||
ok(parts.stream === '/is/fun'); | ||
|
||
parts = vjs.Flash.streamToParts('http://myurl.com/&streaming&/is/fun'); | ||
ok(parts.connection === 'http://myurl.com/'); | ||
ok(parts.stream === 'streaming&/is/fun'); | ||
|
||
parts = vjs.Flash.streamToParts('http://myurl.com/streaming/is/fun'); | ||
ok(parts.connection === 'http://myurl.com/streaming/is/'); | ||
ok(parts.stream === 'fun'); | ||
|
||
parts = vjs.Flash.streamToParts('whatisgoingonhere'); | ||
ok(parts.connection === 'whatisgoingonhere'); | ||
ok(parts.stream === ''); | ||
|
||
parts = vjs.Flash.streamToParts(); | ||
ok(parts.connection === ''); | ||
ok(parts.stream === ''); | ||
}); | ||
|
||
test('test isStreamingSrc', function() { | ||
var isStreamingSrc = vjs.Flash.isStreamingSrc; | ||
ok(isStreamingSrc('rtmp://streaming.is/fun')); | ||
ok(isStreamingSrc('rtmps://streaming.is/fun')); | ||
ok(isStreamingSrc('rtmpe://streaming.is/fun')); | ||
ok(isStreamingSrc('rtmpt://streaming.is/fun')); | ||
// test invalid protocols | ||
ok(!isStreamingSrc('rtmp:streaming.is/fun')); | ||
ok(!isStreamingSrc('rtmpz://streaming.is/fun')); | ||
ok(!isStreamingSrc('http://streaming.is/fun')); | ||
ok(!isStreamingSrc('https://streaming.is/fun')); | ||
ok(!isStreamingSrc('file://streaming.is/fun')); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actual docs, fantastic! Looks good to me. Looks like this is now the pull request to take in and delete the other two. I have a few small comments in here, but nothing major...
A nitpick, but I always see "flash" as "Flash".
Is it playback performance that's the problem with progressive video, or just "playback behavior"? I assume this scrubbing/seeking comment is about the fact that you can't seek into a progressive video as done currently. I was confused here for a second, wondering what the "performance" part of this was.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it might be fair to call it "behavior." Technically the browser is doing progressive playback too with HTML5, its just that its able to request content ranges so it appears to be more responsive when seeking.