mediafront / osmplayer

The Open Standard Media Player is an all-in-one media player for the web. It is an industry changing, open source (MIT) media player that is built to dynamically deliver any type of web media, including HTML5, YouTube, Vimeo, and Flash.
http://www.mediafront.org
MIT License
342 stars 181 forks source link

OSM player won't work without node id #42

Open exteon opened 11 years ago

exteon commented 11 years ago

Eg.

Because the auto-generated ID is no longer valid by jquery standards, it throws a sytax error exception on "#0.53456353" selector

travist commented 11 years ago

Can you provide some more sample code so that I can reproduce and determine the cause?

exteon commented 11 years ago

I have a hard time creating a minimal testcase, but the "point" is that you are using selectors like: $('#0.43256756') which is ambiguous because it can mean element with id 0, class 43256756 or element with id 0.43256756 I cannot reproduce it though on your example page, but in a more complex setup JQuery does blow up at that selector. Maybe the jquery is to blame, but anyway, removing the dot in the autogenerated id should be a really quick workaround.

exteon commented 11 years ago

Wait, I got it: crashes in youtubeplayer like this: change the following in index.html

    <script type="text/javascript">
      $(function() {
        $(".osmplayer",$('body')[0]).osmplayer({
          width: '100%',
          height: '650px',
          file:'http://www.youtube.com/watch?v=7MqrBauptrE'
        });
      });
    </script>
  </head>
  <body>
    <div class="osmplayer"></div>
exteon commented 11 years ago
"Error: An invalid or illegal string was specified.
    at Function.Sizzle (https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js:3983:50)
    at jQuery.fn.extend.find (https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js:5576:11)
    at jQuery.fn.jQuery.init (https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js:196:38)
    at jQuery (https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js:62:10)
    at null.<anonymous> (file:///D:/Temp/osmplayer-2.x/bin/osmplayer.js:5512:19)
    at callLater (file:///D:/Temp/osmplayer-2.x/bin/osmplayer.js:1619:20)"

selector="#0.895523163722828-player"

(Excerpt from Chrome 26.0.1410.64 m), also reproducible on FF 19.0.2 and IE 10.

travist commented 11 years ago

I just did this and it works fine for me... but I am also using an older version of jQuery. Have you tried it with version 1.8.3 of jQuery?

exteon commented 11 years ago

No, I tried with the index.html provided with osmplayer (1.7), up to 1.9.1. Just tried with 1.8.3 and it fails just as miserably. To reproduce: