Browse Source

Remove video canplay event, not triggered properly on Firefox

Jay Salvat 10 years ago
parent
commit
4d313d9162
4 changed files with 8 additions and 24 deletions
  1. 4 12
      dist/vegas.js
  2. 0 0
      dist/vegas.min.js
  3. 0 0
      dist/vegas.min.js.map
  4. 4 12
      src/vegas.js

+ 4 - 12
dist/vegas.js

@@ -265,7 +265,6 @@
             }
             }
 
 
             video = document.createElement('video');
             video = document.createElement('video');
-            // video.muted = true;
             video.preload = true;
             video.preload = true;
 
 
             srcs.forEach(function (src) {
             srcs.forEach(function (src) {
@@ -483,21 +482,13 @@
                     self._slideShow();
                     self._slideShow();
                 }, 100);
                 }, 100);
             }
             }
-
             if (video) {
             if (video) {
                 if (video.readyState === 4) {
                 if (video.readyState === 4) {
                     video.currentTime = 0;
                     video.currentTime = 0;
-                    video.play();
-                    go();
-                } else {
-                    video.oncanplay = function () {
-                        video.play();
-                        if (!video._started) {
-                            video._started = true;
-                            go();
-                        }
-                    };
                 }
                 }
+                
+                video.play();
+                go();
             } else {
             } else {
                 img.src = src;
                 img.src = src;
                 img.onload = go;
                 img.onload = go;
@@ -511,6 +502,7 @@
             for (var i = this.total - 1; i > 0; i--) {
             for (var i = this.total - 1; i > 0; i--) {
                 rand = Math.floor(Math.random() * (i + 1));
                 rand = Math.floor(Math.random() * (i + 1));
                 temp = this.settings.slides[i];
                 temp = this.settings.slides[i];
+
                 this.settings.slides[i] = this.settings.slides[rand];
                 this.settings.slides[i] = this.settings.slides[rand];
                 this.settings.slides[rand] = temp;
                 this.settings.slides[rand] = temp;
             }
             }

File diff suppressed because it is too large
+ 0 - 0
dist/vegas.min.js


File diff suppressed because it is too large
+ 0 - 0
dist/vegas.min.js.map


+ 4 - 12
src/vegas.js

@@ -256,7 +256,6 @@
             }
             }
 
 
             video = document.createElement('video');
             video = document.createElement('video');
-            // video.muted = true;
             video.preload = true;
             video.preload = true;
 
 
             srcs.forEach(function (src) {
             srcs.forEach(function (src) {
@@ -474,21 +473,13 @@
                     self._slideShow();
                     self._slideShow();
                 }, 100);
                 }, 100);
             }
             }
-
             if (video) {
             if (video) {
                 if (video.readyState === 4) {
                 if (video.readyState === 4) {
                     video.currentTime = 0;
                     video.currentTime = 0;
-                    video.play();
-                    go();
-                } else {
-                    video.oncanplay = function () {
-                        video.play();
-                        if (!video._started) {
-                            video._started = true;
-                            go();
-                        }
-                    };
                 }
                 }
+                
+                video.play();
+                go();
             } else {
             } else {
                 img.src = src;
                 img.src = src;
                 img.onload = go;
                 img.onload = go;
@@ -502,6 +493,7 @@
             for (var i = this.total - 1; i > 0; i--) {
             for (var i = this.total - 1; i > 0; i--) {
                 rand = Math.floor(Math.random() * (i + 1));
                 rand = Math.floor(Math.random() * (i + 1));
                 temp = this.settings.slides[i];
                 temp = this.settings.slides[i];
+
                 this.settings.slides[i] = this.settings.slides[rand];
                 this.settings.slides[i] = this.settings.slides[rand];
                 this.settings.slides[rand] = temp;
                 this.settings.slides[rand] = temp;
             }
             }

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