diff options
author | Calvin Tam <calvintam236@gmail.com> | 2015-08-05 20:09:05 -0700 |
---|---|---|
committer | Calvin Tam <calvintam236@gmail.com> | 2015-08-05 20:09:05 -0700 |
commit | 5fcfd5fa4f56f657a53de24c20f8522c37241e0d (patch) | |
tree | 0b2d5a6f280e75099c49f9b5f6e7217237069382 /src/js/plyr.js | |
parent | e1353096709a3cabbf56842d9dc2b52d20cd8a9e (diff) | |
download | plyr-5fcfd5fa4f56f657a53de24c20f8522c37241e0d.tar.lz plyr-5fcfd5fa4f56f657a53de24c20f8522c37241e0d.tar.xz plyr-5fcfd5fa4f56f657a53de24c20f8522c37241e0d.zip |
Eliminated running try catch when player.type="youtube"
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r-- | src/js/plyr.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js index 2b1ab613..2bd83343 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1244,15 +1244,16 @@ targetTime = player.media.duration; } - // Set the current time - // Try/catch incase the media isn't set and we're calling seek() from source() and IE moans - try { - player.media.currentTime = targetTime.toFixed(1); - } - catch(e) {} - + // Set the current time + if(player.type == "video" || player.type == "audio") { + // Try/catch incase the media isn't set and we're calling seek() from source() and IE moans + try { + player.media.currentTime = targetTime.toFixed(1); + } + catch(e) {} + } // YouTube - if(player.type == "youtube") { + else if(player.type == "youtube") { player.embed.seekTo(targetTime); // Trigger timeupdate |