Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3434844
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:44:53+00:00 2026-05-18T07:44:53+00:00

I’m playing with html5 LeanBack Player and it works well when on the page

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T07:44:54+00:00Added an answer on May 18, 2026 at 7:44 am

    Indeed it’s a conflict with Prototypes extending of Array.prototype:

    // leanbackPlayer.js @941
    srt = srt.split('\n\n');
    var i = 0; var isSub = false;
    this.vars.subs[lang] = {};
    this.vars.subs[lang].label = {};
    this.vars.subs[lang].label = label;
    this.vars.subs[lang].track = {};
    
    // Error: using for in over an array is just stupid
    //        not even using hasOwnProperty is outright pitiful
    for(var s in srt) { 
    
        // this will also yield `each` but that's a function which has no .split() method
        var st = srt[s].split('\n');
        var time; var j;
        if(st.length >= 2) {
            var t = "";
    

    In order to fix it you should replace the for(var s in srt) with a simple for loop:

    for(var e = 0, el = srt.length; e < el; e++) {
        var st = srt[e].split('\n');
        var time; var j;
        if(st.length >= 2) {
            var t = "";
            ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a graphics novice, but am playing with HTML5 Canvas, javascript and some
I started playing with HTML5/CSS3 and the new JavaScript API something i noticed in
I've been playing with HTML5 location lookups recently and its relatively straightforward to pull
What's the javascript api for checking if an html5 audio element is currently playing?
http://screencast.com/t/NKb9erVyd0 I'm using the Projekktor HTML5 video player. The video starts playing immediately in
I'm developping a html5 game but i got this problem if a player is
I've been playing with html5 and I've noticed that sometimes the page displays my
I am developing an HTML5 player on Windows, but I have some real difficulties
I setup a HTML5 page, that include a node. The page will to playing
I would like to support playing audio on a web page with HTML5. Currently

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.