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

Remove Flash handling #15

Merged
merged 3 commits into from
Jan 30, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 8 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Maintenance Status: Stable
- [Contributing](#contributing)
- [Talk to us](#talk-to-us)
- [Getting Started](#getting-started)
- [Video.js 6](#videojs-6)
- [Flash Support](#flash-support)
- [Documentation](#documentation)
- [Options](#options)
- [How to use](#how-to-use)
Expand Down Expand Up @@ -60,8 +60,6 @@ Maintenance Status: Stable
- [Segment Metadata](#segment-metadata)
- [Hosting Considerations](#hosting-considerations)
- [Known Issues](#known-issues)
- [IE10 and Below](#ie10-and-below)
- [IE11](#ie11)
- [Fragmented MP4 Support](#fragmented-mp4-support)
- [Testing](#testing)
- [Debugging](#debugging)
Expand Down Expand Up @@ -115,21 +113,9 @@ player.play();

Check out our [live example](http://jsbin.com/vokipos/8/edit?html,output) if you're having trouble.

### Video.js 6
With Video.js 6, by default there is no flash support. Instead, flash support is provided
through the [videojs-flash](https://github.com/videojs/videojs-flash) plugin. If you are
trying to use Video.js version 6 and want to include flash support, you must include
[videojs-flash](https://github.com/videojs/videojs-flash) on your page before including
videojs-http-streaming

```html
<script src="https://unpkg.com/videojs-flash/dist/videojs-flash.js"></script>
<script src="https://unpkg.com/@videojs/http-streaming/dist/videojs-http-streaming.js"></script>
```

Flash, and the [videojs-flash](https://github.com/videojs/videojs-flash) plugin, are not
required, but are recommended as a fallback option for browsers that don't have a native
HLS player or support for [Media Source Extensions](http://caniuse.com/#feat=mediasource).
### Flash Support
This plugin does not support Flash playback. Instead, it is recommended that users use the [videojs-flashls-source-handler](https://github.com/brightcove/videojs-flashls-source-handler) plugin as a fallback option for browsers that don't have a native
[HLS](https://caniuse.com/#feat=http-live-streaming)/[DASH](https://caniuse.com/#feat=mpeg-dash) player or support for [Media Source Extensions](http://caniuse.com/#feat=mediasource).

## Documentation
[HTTP Live Streaming](https://developer.apple.com/streaming/) (HLS) has
Expand All @@ -150,8 +136,8 @@ the best desktop viewing experience.

This project addresses that situation by providing a polyfill for HLS
on browsers that have support for [Media Source
Extensions](http://caniuse.com/#feat=mediasource), or failing that,
support Flash. You can deploy a single HLS stream, code against the
Extensions](http://caniuse.com/#feat=mediasource).
You can deploy a single HLS stream, code against the
regular HTML5 video APIs, and create a fast, high-quality video
experience across all the big web device categories.

Expand Down Expand Up @@ -203,20 +189,11 @@ videojs(video, {html5: {

// or

// flash for flash hls
videojs(video, {flash: {
hls: {
withCredentials: true
}
}});

// or

var options = {hls: {
withCredentials: true;
}};

videojs(video, {flash: options, html5: options});
videojs(video, {html5: options});

```

Expand Down Expand Up @@ -652,18 +629,9 @@ and most CDNs should have no trouble turning CORS on for your account.


## Known Issues
Issues that are currenty know about with workarounds. If you want to
Issues that are currenty known with workarounds. If you want to
help find a solution that would be appreciated!

### IE10 and Below
As of version 5.0.0, IE10 and below are no longer supported.

### IE11
In some IE11 setups there are issues working with its native HTML
SourceBuffers functionality. This leads to various issues, such as
videos stopping playback with media decode errors. The known workaround
for this issues is to force the player to use flash when running on IE11.

### Fragmented MP4 Support
Edge has native support for HLS but only in the MPEG2-TS container. If
you attempt to play an HLS stream with fragmented MP4 segments, Edge
Expand Down
3 changes: 1 addition & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
</head>
<body>
<div class="info">
<p>The video below is an <a href="https://developer.apple.com/library/ios/documentation/networkinginternet/conceptual/streamingmediaguide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008332-CH1-SW1">HTTP Live Stream</a>. On desktop browsers other than Safari, the HLS plugin will polyfill support for the format on top of the video.js Flash tech.</p>
<p>Due to security restrictions in Flash, you will have to load this page over HTTP(S) to see the example in action.</p>
<p>The video below is an <a href="https://developer.apple.com/library/ios/documentation/networkinginternet/conceptual/streamingmediaguide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008332-CH1-SW1">HTTP Live Stream</a>.</p>
</div>
<video id="videojs-http-streaming-player" class="video-js vjs-default-skin" controls>
<source src="https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8" type="application/x-mpegURL">
Expand Down
74 changes: 11 additions & 63 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
"mux.js": "4.3.2",
"url-toolkit": "^2.1.3",
"video.js": "^6.2.0",
"videojs-contrib-media-sources": "4.6.2",
"webworkify": "1.0.2"
},
"devDependencies": {
Expand Down Expand Up @@ -132,7 +131,6 @@
"uglify-js": "^2.5.0",
"videojs-contrib-eme": "^3.0.0",
"videojs-contrib-quality-levels": "^2.0.2",
"videojs-flash": "^2.0.0",
"videojs-standard": "^4.0.3",
"videojs-swf": "^5.2.0",
"watchify": "^3.6.0",
Expand Down
9 changes: 3 additions & 6 deletions src/master-playlist-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export class MasterPlaylistController extends videojs.EventTarget {
let {
url,
withCredentials,
mode,
tech,
bandwidth,
externHls,
Expand All @@ -74,7 +73,6 @@ export class MasterPlaylistController extends videojs.EventTarget {
this.withCredentials = withCredentials;
this.tech_ = tech;
this.hls_ = tech.hls;
this.mode_ = mode;
this.sourceType_ = sourceType;
this.useCueTags_ = useCueTags;
this.blacklistDuration = blacklistDuration;
Expand All @@ -92,7 +90,7 @@ export class MasterPlaylistController extends videojs.EventTarget {

this.mediaTypes_ = createMediaTypes();

this.mediaSource = new videojs.MediaSource({ mode });
this.mediaSource = new videojs.MediaSource();

// load the media source into the player
this.mediaSource.addEventListener('sourceopen', this.handleSourceOpen_.bind(this));
Expand Down Expand Up @@ -194,7 +192,6 @@ export class MasterPlaylistController extends videojs.EventTarget {
tech: this.tech_,
requestOptions: this.requestOptions_,
masterPlaylistLoader: this.masterPlaylistLoader_,
mode: this.mode_,
hls: this.hls_,
master: this.master(),
mediaTypes: this.mediaTypes_,
Expand Down Expand Up @@ -560,7 +557,6 @@ export class MasterPlaylistController extends videojs.EventTarget {
}

if (videojs.browser.IE_VERSION &&
this.mode_ === 'html5' &&
this.tech_.readyState() === 0) {
// IE11 throws an InvalidStateError if you try to set currentTime while the
// readyState is 0, so it must be delayed until the tech fires loadedmetadata.
Expand Down Expand Up @@ -768,7 +764,8 @@ export class MasterPlaylistController extends videojs.EventTarget {
// In flash playback, the segment loaders should be reset on every seek, even
// in buffer seeks. If the seek location is already buffered, continue buffering as
// usual
if (buffered && buffered.length && this.mode_ !== 'flash') {
// TODO: redo this comment
if (buffered && buffered.length) {
return currentTime;
}

Expand Down
10 changes: 2 additions & 8 deletions src/media-groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ export const initialize = {
*/
'AUDIO': (type, settings) => {
const {
mode,
hls,
sourceType,
segmentLoaders: { [type]: segmentLoader },
Expand All @@ -364,12 +363,9 @@ export const initialize = {
}
} = settings;

// force a default if we have none or we are not
// in html5 mode (the only mode to support more than one
// audio track)
// force a default if we have none
if (!mediaGroups[type] ||
Object.keys(mediaGroups[type]).length === 0 ||
mode !== 'html5') {
Object.keys(mediaGroups[type]).length === 0) {
mediaGroups[type] = { main: { default: { default: true } } };
}

Expand Down Expand Up @@ -671,8 +667,6 @@ export const activeTrack = {
* XHR request options used by the segment loaders
* @param {PlaylistLoader} settings.masterPlaylistLoader
* PlaylistLoader for the master source
* @param {String} mode
* Mode of the hls source handler. Can be 'auto', 'html5', or 'flash'
* @param {HlsHandler} settings.hls
* HLS SourceHandler
* @param {Object} settings.master
Expand Down
Loading