Skip to content

Commit 06047b6

Browse files
committed
Only autoplay if muted, plus some debugging handlers
1 parent 226a0f8 commit 06047b6

1 file changed

Lines changed: 26 additions & 5 deletions

File tree

src/loader/filetypes/VideoFile.js

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,19 +186,19 @@ var VideoFile = new Class({
186186
{
187187
video.muted = true;
188188
video.defaultMuted = true;
189+
190+
video.setAttribute('autoplay', 'autoplay');
189191
}
190192

191-
video.setAttribute('autoplay', 'autoplay');
192193
video.setAttribute('playsinline', 'playsinline');
193194
video.setAttribute('preload', 'auto');
194195

195196
var _this = this;
196197

197198
this.onVideoLoadHandler = function (event)
198199
{
199-
// console.log('onVideoLoadHandler');
200-
// console.log(event);
201-
// console.log(_this.config.loadEvent);
200+
console.log('onVideoLoadHandler');
201+
console.log(event);
202202

203203
var video = event.target;
204204

@@ -213,6 +213,27 @@ var VideoFile = new Class({
213213

214214
video.addEventListener(loadEvent, this.onVideoLoadHandler, true);
215215

216+
video.addEventListener('error', function (e)
217+
{
218+
console.log('Load Error');
219+
console.log(e);
220+
}, true);
221+
222+
video.addEventListener('loadstart', function (e)
223+
{
224+
console.log('Load Start');
225+
}, true);
226+
227+
video.addEventListener('loadedmetadata', function (e)
228+
{
229+
console.log('Loaded Meta Data');
230+
}, true);
231+
232+
video.addEventListener('emptied', function (e)
233+
{
234+
console.log('Load Emptied');
235+
}, true);
236+
216237
video.src = GetURL(this, this.loader.baseURL);
217238

218239
video.load();
@@ -229,7 +250,7 @@ VideoFile.create = function (loader, key, urls, loadEvent, asBlob, noAudio, xhrS
229250
if (IsPlainObject(key))
230251
{
231252
urls = GetFastValue(key, 'url', []);
232-
loadEvent = GetFastValue(key, 'loadEvent', 'canplaythrough');
253+
loadEvent = GetFastValue(key, 'loadEvent', 'loadeddata');
233254
asBlob = GetFastValue(key, 'asBlob', false);
234255
noAudio = GetFastValue(key, 'noAudio', false);
235256
xhrSettings = GetFastValue(key, 'xhrSettings');

0 commit comments

Comments
 (0)