|
|
@@ -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;
|