Okay
  Public Ticket #2761738
Embedded videos
Closed

Comments

  •  4
    Informatica Neurovilla started the conversation

    Hello there!

    I'm facing certain problems using the background videos feature, due to the autoplay failing to start the video in some tries. 

    I'd like to know if possible, which PHP or JS file generates the iframe's embedded code for the final HTML file.

    Thank you very much!

  •  279
    Noah replied

    Hi there,

    Thanks for reaching out.

    Please look into these Video Troubleshooting Tips: http://themenectar.com/docs/salient/page-builder-row/#video-background ?.

    Thanks

  •  4
    Informatica Neurovilla replied

    Thank you for the fast answer!

    The documentation has partially solved my problem, since I'm still looking for the .PHP or .JS files which generate the iframe's HTML code used for showing the video on the final page.

  •  4
    Informatica Neurovilla replied

    The reason why I'm looking for those files, is because the autoplay keeps failing sometimes to play the content automatically.

  •  4
    Informatica Neurovilla replied

    Found that init.js located within themes/salient/js/init.js is the script in charge of creating the youtube video player.

  •  4
    Informatica Neurovilla replied

    Also, it seems that after adding some code to handle the event 'onStateChange' it will now autoplay the video without any problems:

    '

    onStateChange: function(event) {
                                        if (event.data == YT.PlayerState.CUED) {
                                            event.target.playVideo();
                                            event.target.setLoop(!0);
                                            event.target.setVolume(0);
                                            event.target.mute();
                                        }
                                    }

    '

    Ticket can now be closed.