Permalink
Browse files

Merge pull request #29 from AltIvan/master

Feature to seek times such as "01:02" (string)
  • Loading branch information...
2 parents 2903e53 + 4e670e6 commit b56bb1ab9d3aa0a6671672b159104541e66b7639 @nirvanatikku committed Mar 27, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 jQuery.tubeplayer.js
View
8 jQuery.tubeplayer.js
@@ -669,6 +669,14 @@
}),
seek: buildFN(function(evt,param,p){
+
+ if (/:/.test(param)) {
+ var parts = param.split(":").reverse();
+ param = 0;
+ for (var i = 0; i < parts.length; i++) {
+ param += Math.pow(60, i) * (parts[i] | 0);
+ }
+ }
p.ytplayer.seekTo(param, true);

0 comments on commit b56bb1a

Please sign in to comment.