Browse Source

stop video on modal close

windhamdavid 2 years ago
parent
commit
2707cb887e
4 changed files with 20 additions and 20 deletions
  1. 2 2
      index.html
  2. 9 9
      js/scripts.js
  3. 9 9
      js/site.js
  4. 0 0
      js/site.js.map

+ 2 - 2
index.html

@@ -426,12 +426,12 @@
           <div class="row mt-5">
             <h5>REDEMPTION</h5>
             <p>(2017) Music copyright Kris Windham. Thanks Jeter.  This is the video for an original composition recorded last year by yours truly.</p>
-            <video controls src="/audio/redemption.mp4" type="video/mp4">
+            <video id="redemption" controls src="/audio/redemption.mp4" type="video/mp4">
           </div>
           <div class="row mt-5">
             <h5>Heart of Darkness The Hollow Men T.S. Eliot</h5>
             <p>(2016) Marlon Brando as Col. Kurtz reading T.S.  Eliot from the film Apocalypse Now with the addition of an original house music audio track.</p>
-            <video controls src="/audio/hollow_men.mp4" type="video/mp4">
+            <video id="hollow" controls src="/audio/hollow_men.mp4" type="video/mp4">
           </video>
           </div>
         </div>

+ 9 - 9
js/scripts.js

@@ -106,13 +106,13 @@ for( var i = 0; i < songElements.length; i++ ){
 }
 
 
-//var myModal = new bootstrap.Modal(document.getElementById('About'), {});
-//myModal.show();
-
-//document.addEventListener("DOMContentLoaded", function() {
-//	if (window.location.href.indexOf("#modal") > -1) {
-//		var mobileModal = new bootstrap.Modal(document.getElementById('mobile'));
-//		mobileModal.show();
-//	}
-//});
+const myModalEl = document.getElementById('Video');
+var video = document.getElementById("redemption");
+function stopVideo() {
+	video.pause();
+	video.currentTime = 0;
+}
+myModalEl.addEventListener('hidden.bs.modal', event => {
+  stopVideo();
+})
 

+ 9 - 9
js/site.js

@@ -13537,15 +13537,15 @@ for( var i = 0; i < songElements.length; i++ ){
 }
 
 
-//var myModal = new bootstrap.Modal(document.getElementById('About'), {});
-//myModal.show();
-
-//document.addEventListener("DOMContentLoaded", function() {
-//	if (window.location.href.indexOf("#modal") > -1) {
-//		var mobileModal = new bootstrap.Modal(document.getElementById('mobile'));
-//		mobileModal.show();
-//	}
-//});
+const myModalEl = document.getElementById('Video');
+var video = document.getElementById("redemption");
+function stopVideo() {
+	video.pause();
+	video.currentTime = 0;
+}
+myModalEl.addEventListener('hidden.bs.modal', event => {
+  stopVideo();
+})
 
 
 //# sourceMappingURL=site.js.map

File diff suppressed because it is too large
+ 0 - 0
js/site.js.map


Some files were not shown because too many files changed in this diff