diff options
author | Sam Potts <me@sampotts.me> | 2015-07-12 23:57:36 +1000 |
---|---|---|
committer | Sam Potts <me@sampotts.me> | 2015-07-12 23:57:36 +1000 |
commit | dcd9ca3a93a669b69f0e4fc7831bd645ce0ec3ee (patch) | |
tree | c21556616a13ff231e567ecb5875f6f9cb0770ba /src/js | |
parent | c202cc1ffb034e2dcf96ed8dc3bd92a2b6a6f021 (diff) | |
download | plyr-dcd9ca3a93a669b69f0e4fc7831bd645ce0ec3ee.tar.lz plyr-dcd9ca3a93a669b69f0e4fc7831bd645ce0ec3ee.tar.xz plyr-dcd9ca3a93a669b69f0e4fc7831bd645ce0ec3ee.zip |
Started on source swap
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/plyr.js | 11 |
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(); |