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

Using src attribute instead of source element #5701

Closed
wants to merge 1 commit into from
Closed
Changes from all 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
38 changes: 25 additions & 13 deletions src/js/tech/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,34 @@ class MediaLoader extends Component {
// load the first supported playback technology.

if (!options.playerOptions.sources || options.playerOptions.sources.length === 0) {
for (let i = 0, j = options.playerOptions.techOrder; i < j.length; i++) {
const techName = toTitleCase(j[i]);
let tech = Tech.getTech(techName);
if (typeof(options.playerOptions.src) == 'undefined') {
for (let i = 0, j = options.playerOptions.techOrder; i < j.length; i++) {
const techName = toTitleCase(j[i]);
let tech = Tech.getTech(techName);

// Support old behavior of techs being registered as components.
// Remove once that deprecated behavior is removed.
if (!techName) {
tech = Component.getComponent(techName);
}
// Support old behavior of techs being registered as components.
// Remove once that deprecated behavior is removed.
if (!techName) {
tech = Component.getComponent(techName);
}

// Check if the browser supports this technology
if (tech && tech.isSupported()) {
player.loadTech_(techName);
break;
// Check if the browser supports this technology
if (tech && tech.isSupported()) {
player.loadTech_(techName);
break;
}
}
}
else {
var src = options.playerOptions.src;
var type = "video/" + src.slice((src.lastIndexOf(".") - 1 >>> 0) +2 );
options.playerOptions.sources = [
{
type: type,
src: src
}
];
}
}
} else {
// Loop through playback technologies (HTML5, Flash) and check for support.
// Then load the best source.
Expand Down