Archived

This topic is now archived and is closed to further replies.

  • 0

modal, javascript & jwplayer


Question

Posted · Report post

Hi,

 

I am trying to implement javascript in a modal window. I am using the shortcode from pagelines  [pl_modal etc.

 

This is the code i am putting in the modal window between [pl_modal (this code implements the jwplayer for audio/video html5)

 

<div id="myElement2">Loading the player...</div>

<script type="text/javascript">
    jwplayer("myElement2").setup({
        file: "http://www.dancemoves.nl/snatam-mul.mp3",
         height: 40,
        width: 350,
        autostart:true        
        
    });
</script>

 

Result: only seeing the text "Loading the player..." nothing is replaced. In the div should the player appear.

 

Is it possible to do this? So far i implemented an iframe tag and builded the player on a separate page. But this is more direct.

 

There is also a javascript. placed in <head> needed for working correctly. Maybe this script cannot be reached correctly from modal window? I don't know.

 

If this solution works it also solves the youtube video problem, as long as embedding is allowed from YT.

 

Thanks.

Share this post


Link to post
Share on other sites

2 answers to this question

Posted · Report post

Crazy! The player is loaded in the topic. Amazing!

Share this post


Link to post
Share on other sites

Posted · Report post

HI,

 

You may not be able to add this to a modal window, due to a possible .js conflict.

 

However, can you add the code to our paste service so I can try myself, as you can see above the code has become slightly corrupt.

Share this post


Link to post
Share on other sites