Jump to content


Photo
- - - - -

modal, javascript & jwplayer

modal jwplayer

  • Please log in to reply
2 replies to this topic

#1 evert100

evert100

    Super Member

  • Members
  • 156 posts
  • Framework Version:2.3.8.
  • Country: Country Flag

Posted 11 February 2013 - 08:53 AM

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: " ",
         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.



#2 evert100

evert100

    Super Member

  • Members
  • 156 posts
  • Framework Version:2.3.8.
  • Country: Country Flag

Posted 11 February 2013 - 08:54 AM

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



#3 Danny

Danny

    Is Awesome!

  • Moderators
  • 15194 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 11 February 2013 - 11:12 AM

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.







Also tagged with one or more of these keywords: modal, jwplayer