Started on source swap

This commit is contained in:
Sam Potts 2015-07-12 23:57:36 +10:00
parent c202cc1ffb
commit dcd9ca3a93
2 changed files with 12 additions and 1 deletions

2
dist/plyr.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1584,6 +1584,17 @@
// Update source
// Sources are not checked for support so be careful
function _parseSource(sources) {
// YouTube
if(player.type === "youtube" && typeof sources === "string") {
if(sources.indexOf("http") === 0) {
player.embed.loadVideoByUrl(sources);
}
else {
player.embed.loadVideoById(sources);
}
return;
}
// Pause playback (webkit freaks out)
_pause();