ソースを参照

Changed preserveDrawingBuffer to be an option

rasmusvhansen 9 年 前
コミット
3086dfea2d
共有1 個のファイルを変更した2 個の追加1 個の削除を含む
  1. 2 1
      jsmpg.js

+ 2 - 1
jsmpg.js ファイルの表示

@@ -18,6 +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 22
 	this.externalLoadCallback = opts.onload || null;
22 23
 	this.externalDecodeCallback = opts.ondecodeframe || null;
23 24
 	this.externalFinishedCallback = opts.onfinished || null;
@@ -928,7 +929,7 @@ jsmpeg.prototype.initWebGL = function() {
928 929
 
929 930
 	// attempt to get a webgl context
930 931
 	try {
931
-		var options = { preserveDrawingBuffer: true };
932
+    		var options = { preserveDrawingBuffer: this.preserveDrawingBuffer };
932 933
 		gl = this.gl = this.canvas.getContext('webgl', options) || this.canvas.getContext('experimental-webgl', options);
933 934
 	} catch (e) {
934 935
 		return false;