Jump to content
evert100

modal, javascript & jwplayer

Recommended Posts

evert100    1
evert100

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
evert100    1
evert100

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

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

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.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

    • Jesper
      By Jesper+
      Is there a way to create modal popups? It was possible ind DMS2
    • arcangel
      By arcangel
      Hi
      I hope someone can help I have built a landing page for my client using Pagelines DMS.
      http://inspire.arcangel.com/landing-page/
      At the bottom of the page there are some flags each opens a different modal with a 'RightSignature' contract within an Iframe.
      All works fine on a desktop, but for some reason when trying to go to the landing page on a handheld device it starts loading the page then all of a sudden it loads up a page displaying one of the contracts instead.
      Does anyone know what could be causing this? or think of a solution?
      Many thanks
      Lee
       
    • yemoonyah
      By yemoonyah+
      Hi,
       
      I created a modal with a registration form inside (using the Pagelines modal shortcodes).
       
      On top of the form and right before the submit button there are huge white spaces that I can't seem to get rid of. I tried using Chrome Developer tools but I just can't figure out what is going on and how to fix it.
       
      It's not an issue with the S2member registration form because outside the modal it works fine.
       
      http://CreativeWebBiz.com/challenge 
       
      (click on 'I'm in" button to open the modal)
       
       
      Pagelines, WP and all plugins are up to date
      Host: WP Engine
       
       
      Any suggestions?
       
      Thanks
      Yamile
    • ketri
      By ketri
      Hi!

      When I insert a youtube-embed inside a modal, it won't work. I tried to have:
       
       <div class=" fitvids">         <iframe  src="//www.youtube.com/embed/88NV75YRAnc?&iv_load_policy=3&theme=light&color=red&rel=0&showinfo=0&autohide=1&enablejsapi=1" frameborder="0"  allowfullscreen></iframe>       </div> But that won't work on mobile either.

      Thank you!
       
    • ketri
      By ketri
      https://www.dropbox.com/s/6eszqbgciqumxre/Screenshot%202014-08-15%2012.41.48.png
      If I'm using custom fonts (like typekit) I'll need to override these here also...

      Thank you very much!
×