cssarma / flowplayer-plugins

Automatically exported from code.google.com/p/flowplayer-plugins
0 stars 0 forks source link

iPad plugin fail to extract extension if URL has . in query string #18

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In flowplayer.ipad.js, trunk,

240: extendedClip.extension = 
extendedClip.completeUrl.substr(extendedClip.completeUrl.lastIndexOf('.'));

extension will be extracted incorrectly if completeUrl has . (dot) in query 
string.

Original issue reported on code.google.com by iwatth on 16 Aug 2011 at 10:05

GoogleCodeExporter commented 8 years ago
Here's my fix.

Original comment by iwatth on 16 Aug 2011 at 10:13

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you. But have you actually tried your proposal?

x = 'test.mp4?test=hello';
queryIndex = x.indexOf('?');
x.substr(x.lastIndexOf('.' , queryIndex));
".mp4?test=hello"

This seems to work better:

x = 'test.mp4?test=hello';
queryIndex = x.indexOf('?');
if (queryIndex > -1) x = x.substr(0, queryIndex);
x.substr(x.lastIndexOf('.'))
".mp4"

Original comment by blacktrashproduct on 5 Jun 2012 at 10:51

GoogleCodeExporter commented 8 years ago
Well, I think my code was difference than the one I'm using. Thanks
for correction.

Original comment by iwatth on 5 Jun 2012 at 11:08

GoogleCodeExporter commented 8 years ago
Fixed in http://code.google.com/p/flowplayer-plugins/source/detail?r=1911

Original comment by blacktrashproduct on 5 Jun 2012 at 11:11