Play and stop Vimeo video placed in Bootstrap modal -


I am a Vimeo iframe when I model trigger video Bootstrap video and when a model closes the play-off Then I have to start playing. Currently, I may have to start playing by opening the modal with the IFrame with a feature feature and it can be loaded with jQuery by triggering this model, this is the code snippet;

  jQuery ("# ​​videogumb"). Click (function () {jQuery ('# mymodal .modal-body iframe'). Attr ('src', '-source-code');});   

It works fine and I start it when the modal opens, but when I turn off the music, the music plays in the background.

The second method works fine, but only when it's set to autoplay is set to autoplay and I have this snippet to turn off the modal without setting it to autoplay;

  jQuery ("Modal-backdrop, #m modal. Close, #mymodal .btn"). Attr ("# myModal iframe"). Attr ("# myModal iframe"). Attr ("src"));}); < / Code>  

When I turn off the modal, this video stops. I should be combined in any way when the medal opens and when the modal closes to stop playing I have to autoplay it.

Any clue?

Thanks.

To add aerosag to the answer, check the documentation of Vimeo.

  1. Wbumic embed code API = 1 and Kiladhi_aid = vimeoplayer Add like:

    & lt; iframe src = "// Pleyrkvimokcom/veedio/ll6l60l60 ? api = 1 & pplplayer_id = vimeoplayer & amp; title = 0 & amp; amp; byline = 0 & amp; amp; portrait = 0 "name =" vimeoplayer "Id =" nofocusvideo "width =" 615 "height =" 346 "Frembardr =" 0 "Vebkitolofloskrin Mojlaoplskrin Acceptable screen & gt; & Lt; / Iframe & gt; Note - I gave it an ID named 'NofocasVideo' which will be watched here: >

      var iframe = documents like aliorem BIID ('nofocasvideo'); Announce 2 variables above the aeroding JS such as:   

    / p>

      & lt; Script src = "http://a.vimeocdn.com/js/froogaloop2.min.js" & gt; & Lt; / Script & gt; & Lt; Script & gt; Var iframe = document.getElementById ('nofocusvideo'); // $ f == Frauglup Verwer Player = $ F ($); $ ('Modal'). ('Hidden.bs.modal', function () {player.api ('pause');}) $ ('modal'). At ('show.bs.modal', function () {player.api ('play');}) & lt; / Script & gt;      

    Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -