Skip to content

Commit

Permalink
Merge pull request #334 from ooyala/PLAYER-4169
Browse files Browse the repository at this point in the history
Player 4169
  • Loading branch information
aeng7 authored Sep 11, 2018
2 parents 3ecf2ae + 13836f9 commit e91bbb9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion html5-common
15 changes: 13 additions & 2 deletions src/main/js/main_html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ require("../../../html5-common/js/utils/environment.js");
list.push(OO.VIDEO.ENCODING.MP4);
}

if (!!videoElement.canPlayType("audio/ogg")) {
list.push(OO.VIDEO.ENCODING.OGG);
}

if (!!videoElement.canPlayType("audio/x-m4a")) {
list.push(OO.VIDEO.ENCODING.M4A);
}

if (!!videoElement.canPlayType("video/webm")) {
list.push(OO.VIDEO.ENCODING.WEBM);
}
Expand All @@ -52,16 +60,18 @@ require("../../../html5-common/js/utils/environment.js");
list.push(OO.VIDEO.ENCODING.HLS);
list.push(OO.VIDEO.ENCODING.AKAMAI_HD2_VOD_HLS);
list.push(OO.VIDEO.ENCODING.AKAMAI_HD2_HLS);
list.push(OO.VIDEO.ENCODING.AUDIO_ONLY_HLS);
}

// Sony OperaTV supports HLS but doesn't properly report it so we are forcing it here
if (window.navigator.userAgent.match(/SonyCEBrowser/)) {
list.push(OO.VIDEO.ENCODING.HLS);
list.push(OO.VIDEO.ENCODING.AKAMAI_HD2_VOD_HLS);
list.push(OO.VIDEO.ENCODING.AKAMAI_HD2_HLS);
list.push(OO.VIDEO.ENCODING.AUDIO_ONLY_HLS);

}
}

return list;
};
this.encodings = getSupportedEncodings();
Expand Down Expand Up @@ -326,7 +336,8 @@ require("../../../html5-common/js/utils/environment.js");

isM3u8 = (encoding == OO.VIDEO.ENCODING.HLS ||
encoding == OO.VIDEO.ENCODING.AKAMAI_HD2_VOD_HLS ||
encoding == OO.VIDEO.ENCODING.AKAMAI_HD2_HLS
encoding == OO.VIDEO.ENCODING.AKAMAI_HD2_HLS ||
encoding == OO.VIDEO.ENCODING.AUDIO_ONLY_HLS
);
isLive = live;
urlChanged = true;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/main_html5/factory-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('main_html5 factory tests', function () {

it('should provide a list of supported encodings', function(){
// This is controlled by document.createElement("video").canPlayType(type);
expect(pluginFactory.encodings).to.eql([OO.VIDEO.ENCODING.MP4, OO.VIDEO.ENCODING.WEBM, OO.VIDEO.ENCODING.HLS, OO.VIDEO.ENCODING.AKAMAI_HD2_VOD_HLS, OO.VIDEO.ENCODING.AKAMAI_HD2_HLS]);
expect(pluginFactory.encodings).to.eql([OO.VIDEO.ENCODING.MP4, OO.VIDEO.ENCODING.OGG, OO.VIDEO.ENCODING.M4A, OO.VIDEO.ENCODING.WEBM, OO.VIDEO.ENCODING.HLS, OO.VIDEO.ENCODING.AKAMAI_HD2_VOD_HLS, OO.VIDEO.ENCODING.AKAMAI_HD2_HLS, OO.VIDEO.ENCODING.AUDIO_ONLY_HLS]);
});

it('should provide a list of supported features', function(){
Expand Down

0 comments on commit e91bbb9

Please sign in to comment.