Przeglądaj źródła

Documented preserveDrawingBuffer option

Rasmus Vestergaard Hansen 9 lat temu
rodzic
commit
12b30f2797
2 zmienionych plików z 3 dodań i 2 usunięć
  1. 1 0
      README.md
  2. 2 2
      jsmpg.js

+ 1 - 0
README.md Wyświetl plik

@@ -25,6 +25,7 @@ The `options` argument to the `jsmpeg()` supports the following properties:
25 25
 - `autoplay` whether playback should start automatically after loading
26 26
 - `loop` whether playback is looped
27 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 29
 - `onload` a function that's called once, after the .mpg file has been completely loaded
29 30
 - `ondecodeframe` a function that's called after every frame that's decoded and rendered to the canvas
30 31
 - `onfinished` a function that's called when playback ends

+ 2 - 2
jsmpg.js Wyświetl plik

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