I’m playing with html5 LeanBack Player and it works well when on the page only its javascritpts. But if I add these javascript files to rails 3 project then I get error in LeanBack Player’s javascript file:
Uncaught TypeError: Object function each(iterator, context) {
var index = 0;
try {
this._each(function(value) {
iterator.call(context, value, index++);
});
} catch (e) {
if (e != $break) throw e;
}
return this;
} has no method ‘split’
in function LBPlayer.prototype.resolveTextPlainSubs.
I guessed that’s because of conflict with native Prototype in rails but I don’t know how to resolve it.
Thanks
Indeed it’s a conflict with Prototypes extending of
Array.prototype:In order to fix it you should replace the
for(var s in srt)with a simple for loop: