Skip to content

Commit

Permalink
Update samples that used MediaPlayerFactory.
Browse files Browse the repository at this point in the history
This should resolve Dash-Industry-Forum#1136 and replace Dash-Industry-Forum#1135
  • Loading branch information
boushley committed Feb 6, 2016
1 parent cee121f commit 99930ba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
}
</style>

<body onload="dashjs.MediaPlayerFactory.createAll()">
<body>
<div>
<video class="dashjs-player" autoplay src="http://dash.edgesuite.net/envivio/EnvivioDash3/manifest.mpd" controls="true"/>
<video data-dashjs-player autoplay src="http://dash.edgesuite.net/envivio/EnvivioDash3/manifest.mpd" controls="true"/>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
}
</style>

<body onload="dashjs.MediaPlayerFactory.createAll()">
<body>
<div>
<video class="dashjs-player" autoplay preload="none" controls="true">
<video autoplay preload="none" controls="true">
<source src="http://dash.edgesuite.net/envivio/EnvivioDash3/manifest.mpd" type="application/dash+xml"/>
</video>
</div>
Expand Down
7 changes: 2 additions & 5 deletions src/streaming/MediaPlayerFactory.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import FactoryMaker from '../core/FactoryMaker.js';
import MediaPlayer from './MediaPlayer.js';

function MediaPlayerFactory() {
Expand Down Expand Up @@ -93,9 +92,7 @@ function MediaPlayerFactory() {
};
}

MediaPlayerFactory.__dashjs_factory_name = 'MediaPlayerFactory';
let factoryFactory = FactoryMaker.getSingletonFactory(MediaPlayerFactory);
let instance = factoryFactory().getInstance();
let instance = MediaPlayerFactory();

function loadHandler() {
window.removeEventListener('load', loadHandler);
Expand All @@ -104,7 +101,7 @@ function loadHandler() {

let avoidAutoCreate = window && window.dashjs && window.dashjs.skipAutoCreate;

if (window && window.addEventListener && !avoidAutoCreate) {
if (!avoidAutoCreate && window && window.addEventListener) {
if (window.document.readyState === 'complete') {
instance.createAll();
} else {
Expand Down

0 comments on commit 99930ba

Please sign in to comment.