开发者

MediaElement.js jquery bug

I have an gwt application and I use MediaElement.js to show multimedia contents. If I put on the main p开发者_JAVA技巧age this script

<script> // using jQuery   
    $('video,audio').mediaelementplayer();
</script>

to convert and tags in MediaElement.js and it doesn't work.

  1. First because this script convert only one tag or in MediaElement.js
  2. Second this tag must be before the script. If it is after it doesn't work.

So my problem is that I have more than one tag and this tags are created runtime so they will be after the script. I think that the correct work of the script should be: Convert all and tags within the page and not the only one before the script.

Thanks


If you can't move the script until after the tags, then you should either do

<script>
jQuery(document).ready(function($) {
    $('video').mediaelementplayer();
});
</script>

or

<script>
// your code
gwtCode();
$('video').mediaelementplayer();    
</script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜