aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSam Potts <me@sampotts.me>2015-07-12 23:57:36 +1000
committerSam Potts <me@sampotts.me>2015-07-12 23:57:36 +1000
commitdcd9ca3a93a669b69f0e4fc7831bd645ce0ec3ee (patch)
treec21556616a13ff231e567ecb5875f6f9cb0770ba /src
parentc202cc1ffb034e2dcf96ed8dc3bd92a2b6a6f021 (diff)
downloadplyr-dcd9ca3a93a669b69f0e4fc7831bd645ce0ec3ee.tar.lz
plyr-dcd9ca3a93a669b69f0e4fc7831bd645ce0ec3ee.tar.xz
plyr-dcd9ca3a93a669b69f0e4fc7831bd645ce0ec3ee.zip
Started on source swap
Diffstat (limited to 'src')
-rw-r--r--src/js/plyr.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 665a8782..41abe085 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -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();