Selaa lähdekoodia

VideoSource: small changes

customisations
alemart 1 vuosi sitten
vanhempi
commit
7169da1948
1 muutettua tiedostoa jossa 8 lisäystä ja 2 poistoa
  1. 8
    2
      src/sources/video-source.ts

+ 8
- 2
src/sources/video-source.ts Näytä tiedosto

147
                     video.hidden = false;
147
                     video.hidden = false;
148
                     video.style.setProperty('opacity', '0');
148
                     video.style.setProperty('opacity', '0');
149
                     video.style.setProperty('position', 'absolute');
149
                     video.style.setProperty('position', 'absolute');
150
+                    //video.style.setProperty('display', 'none'); // doesn't work. Same as video.hidden
151
+                    //video.style.setProperty('visibility', 'hidden'); // doesn't work either
150
                 }
152
                 }
151
 
153
 
152
             }
154
             }
174
             return Speedy.Promise.resolve(video);
176
             return Speedy.Promise.resolve(video);
175
 
177
 
176
         // videos marked with autoplay should be muted
178
         // videos marked with autoplay should be muted
177
-        video.muted = true;
179
+        if(!video.muted) {
180
+            Utils.warning('Videos marked with autoplay should be muted', video);
181
+            video.muted = true;
182
+        }
178
 
183
 
179
         // the browser may not honor the autoplay attribute if the video is not
184
         // the browser may not honor the autoplay attribute if the video is not
180
         // visible on-screen. So, let's try to play the video in any case.
185
         // visible on-screen. So, let's try to play the video in any case.
262
                     clearInterval(t);
267
                     clearInterval(t);
263
                     resolve(video);
268
                     resolve(video);
264
                 }
269
                 }
265
-                else if((ms += INTERVAL) > TIMEOUT) {
270
+                else if((ms += INTERVAL) >= TIMEOUT) {
271
+                    clearInterval(t);
266
                     reject(new TimeoutError('The video took too long to load'));
272
                     reject(new TimeoutError('The video took too long to load'));
267
                 }
273
                 }
268
 
274
 

Loading…
Peruuta
Tallenna