2017-10-10 8 views
0

Light YouTube Embeds script by @labnol과 함께 최신 Foundation 6.4.x을 사용하고 있습니다.Light YouTube 사용하기 모달과 함께 임베드하기 (Foundation 공개) - 모달 윈도우 닫기 후에 비디오 재생을 멈추는 방법?

내가 표준 HTML 페이지에이 코드를 사용 :이 부분

<button data-toggle="animatedModalVideoTest1" class="hollow button expanded alert" href="##">View video</button> 

그리고 해당 재단은 모달 공개입니다 :

<div class="reveal" id="animatedModalVideoTest1" data-reveal data-close-on-click="true" data-animation-in="fade-in" data-animation-out="fade-out"> 
<button class="button float-right" data-close type="button"> 
    <span aria-hidden="true">&times;</span> Close modal window 
</button> 

<div class="responsive-embed"> 
    <div class="youtube-player" data-id="xecEV4dSAXE"></div> 
</div> 

나는 "창 닫기"를 클릭하면 , 비디오는 백그라운드에서 계속 재생됩니다. 모든 JS 프로 방법이 훨씬

PS :-) 주시면 감사하겠습니다 중지하는 아이디어를 제안 할 수있는 사람 : 여기에 링크 된 영상은 ..이 링크를 사용하는

답변

0

봅니다 (존 올리버) 작업 안전 zurb-forum : https://foundation.zurb.com/forum/posts/39375-stop-video-when-closing-a-reveal-modal-with-foundation-6 .. 나를 위해 일합니다!

마크 업에 data-reset-on-close="true"을 삽입하십시오.

<div class="large reveal" id="myvideo" data-reveal data-reset-on-close="true"> 

     <iframe width="560" height="315" src="https://www.youtube.com/embed/xxxyyyzzz?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen=""></iframe> 

     <button class="close-button close-reveal-modal" data-close aria-label="Close reveal" type="button"> 
     <span aria-hidden="true">&times;</span> 
     </button> 
    </div>