Bläddra i källkod

Documented preserveDrawingBuffer option

Rasmus Vestergaard Hansen 9 år sedan
förälder
incheckning
12b30f2797
2 ändrade filer med 3 tillägg och 2 borttagningar
  1. 1 0
      README.md
  2. 2 2
      jsmpg.js

+ 1 - 0
README.md Visa fil

25
 - `autoplay` whether playback should start automatically after loading
25
 - `autoplay` whether playback should start automatically after loading
26
 - `loop` whether playback is looped
26
 - `loop` whether playback is looped
27
 - `seekable` whether a seek-index is build during load time; neccessary for `seekToFrame` and `seekToTime` methods
27
 - `seekable` whether a seek-index is build during load time; neccessary for `seekToFrame` and `seekToTime` methods
28
+- `progressiveThrottled` whether to throttle downloading chunks until they're needed for playback. Requires `progressive`; default `false`.
28
 - `onload` a function that's called once, after the .mpg file has been completely loaded
29
 - `onload` a function that's called once, after the .mpg file has been completely loaded
29
 - `ondecodeframe` a function that's called after every frame that's decoded and rendered to the canvas
30
 - `ondecodeframe` a function that's called after every frame that's decoded and rendered to the canvas
30
 - `onfinished` a function that's called when playback ends
31
 - `onfinished` a function that's called when playback ends

+ 2 - 2
jsmpg.js Visa fil

18
 	this.wantsToPlay = this.autoplay;
18
 	this.wantsToPlay = this.autoplay;
19
 	this.loop = !!opts.loop;
19
 	this.loop = !!opts.loop;
20
 	this.seekable = !!opts.seekable;
20
 	this.seekable = !!opts.seekable;
21
-  	this.preserveDrawingBuffer = !!opts.preserveDrawingBuffer;
21
+  this.preserveDrawingBuffer = !!opts.preserveDrawingBuffer;
22
 	this.externalLoadCallback = opts.onload || null;
22
 	this.externalLoadCallback = opts.onload || null;
23
 	this.externalDecodeCallback = opts.ondecodeframe || null;
23
 	this.externalDecodeCallback = opts.ondecodeframe || null;
24
 	this.externalFinishedCallback = opts.onfinished || null;
24
 	this.externalFinishedCallback = opts.onfinished || null;
929
 
929
 
930
 	// attempt to get a webgl context
930
 	// attempt to get a webgl context
931
 	try {
931
 	try {
932
-    		var options = { preserveDrawingBuffer: this.preserveDrawingBuffer };
932
+    var options = { preserveDrawingBuffer: this.preserveDrawingBuffer };
933
 		gl = this.gl = this.canvas.getContext('webgl', options) || this.canvas.getContext('experimental-webgl', options);
933
 		gl = this.gl = this.canvas.getContext('webgl', options) || this.canvas.getContext('experimental-webgl', options);
934
 	} catch (e) {
934
 	} catch (e) {
935
 		return false;
935
 		return false;