JWPlayer in Drupal has container ID starting with Numeric Character Following up this question on SO, I am looking to change the default DIV container name that JWplayer provides to JWPlayer Div. The problem is that it starts with a numeric and that creates loading problems.

Is there a way, I can customize this JWPlayer ID ?

This is how it looks btw,

jwplayer('141ef7fe77391234fc105767808cc0a5').setup({"file":"my_video.mp4",
      "width":"838","height":"383","controlbar":"none",
      "modes":[{"type":"html5"},{"type":"flash","src":"http://path/jwplayer/player.swf"}]});
While you're at it, here is a quick solution to it.

Since this is a fix for Drupal JWPlayer Module, do the following:-


Go to jw_player module folder and open theme folder.
Open jw_player.tpl.php and add the following line on top (probably where PHP declaration starts).



$html_id = "myvideo". $html_id;



It kinda does the job but I am sure you guys have better solutions than this. Please feel free to comment.

Found a better solution

Don't do upper suggestion. Paste the following code in jw_player.module instead.

Find this line $variables['html_id'] = md5(rand()); (I guess line 308) and uncomment it before pasting the following code instead.

while(1) {

      $variables['html_id'] = md5(rand());
      if (ctype_alpha(substr($variables['html_id'], 0, 1))) {
        //echo "First Digit is Alphabet";
        break;
      }

  }


Thanks.