Closed GoogleCodeExporter closed 9 years ago
A "patch" against the obfuscated code, which should work for both expression
formats (except offset expressions with unit "ticks"):
reClock = /(\d\d):(\d\d):(\d\d)(?:(\.\d+)|:(\d+))?/,
reOffset = /(\d+)(\.\d+)?(h|ms|m|s|f|t)/,
pe = function (b, fps) {
var d,c;
if((c = b.match(reClock)) != null) {
// hours ":" minutes ":" seconds ( fraction | ":" frames ( "." sub-frames )? )?
d = 3600 * parseInt(c[1], 10) + 60 * parseInt(c[2], 10) + parseFloat(c[3]);
if(c[4]) // fractions as ".\d+"
d+= parseFloat(c[4]);
else if(c[5]) // frames
d += (parseInt(c[5], 10) / fps);
}else if ((c = b.match(reOffset)) != null) {
// time-count fraction? metric
d = parseInt(c[1], 10);
if(c[2]) // Fractions as ".\d+"
d+= parseFloat(c[2], 10);
switch(c[3]) {
case 'h': d*=3600; break;
case 'm': d*=60; break;
//case 's': break;
case 'ms': d/=1000; break;
case 'f': d/=fps; break;
case 't': throw new Error("no ticks support in TTML parser");
}
}
return d;
},
Note that fps is from parameter here instead of this.somevariable.
Original comment by head...@gmail.com
on 25 Apr 2014 at 5:13
Thanks, an internal issue was opened. I will keep this ticket updated with the
new info when it is available.
Original comment by anad...@google.com
on 4 May 2014 at 7:51
This is now supported in MPL 1.0
//www.gstatic.com/cast/sdk/libs/mediaplayer/1.0.0/media_player.js
Original comment by vadi...@chromium.org
on 25 Sep 2014 at 4:33
This has been fixed. See the above comment.
Original comment by and...@google.com
on 8 Oct 2014 at 4:33
Original issue reported on code.google.com by
head...@gmail.com
on 25 Apr 2014 at 7:48