cssarma / flowplayer-plugins

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

ipad: make validExtensions and posterExtensions configurable #39

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Both validExtensions and posterExtensions are already set up as options, but 
difficult to configure.

Make them configurable as case-insensitive regexes by better (or more 
canonical) use of the new RegExp function, i.e. turn:

opts = {
  // [...]
  posterExtensions: /jgp|png/gi
}
var posterExtensions = new RegExp(opts.posterExtensions.source);

into:

opts = {
  // [...]
  posterExtensions: 'jpg|png' // string!
}
var posterExtensions = new RegExp(opts.posterExtensions, 'gi'); // (regex, 
flags)

With the necessary caveats they then can be documented as public options.

After issue18 has been fixed this is not desperately needed, but there might 
still be strange "playlist" extensions around which might work otherwise.

Original issue reported on code.google.com by blacktrashproduct on 18 Jun 2012 at 11:09

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
And while we are at it, make the regex stricter: the 'g' flag is bogus and 
useless here, and we also do not want to stumble over 'mp4flv' and whatever 
crazy stuff might be around. So:

var posterExtensions = new RegExp('^\.(' + opts.posterExtensions + ')$', 'i');

Original comment by blacktrashproduct on 18 Jun 2012 at 11:35

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

Original comment by blacktrashproduct on 18 Jun 2012 at 11:52