|
|
@@ -8,6 +8,7 @@ var jsmpeg = window.jsmpeg = function(url, opts) {
|
|
8
|
8
|
this.wantsToPlay = this.autoplay;
|
|
9
|
9
|
this.loop = !!opts.loop;
|
|
10
|
10
|
this.seekable = !!opts.seekable;
|
|
|
11
|
+ this.preserveDrawingBuffer = !!opts.preserveDrawingBuffer;
|
|
11
|
12
|
this.externalLoadCallback = opts.onload || null;
|
|
12
|
13
|
this.externalDecodeCallback = opts.ondecodeframe || null;
|
|
13
|
14
|
this.externalFinishedCallback = opts.onfinished || null;
|
|
|
@@ -1008,7 +1009,8 @@ jsmpeg.prototype.initWebGL = function() {
|
|
1008
|
1009
|
|
|
1009
|
1010
|
// attempt to get a webgl context
|
|
1010
|
1011
|
try {
|
|
1011
|
|
- gl = this.gl = this.canvas.getContext('webgl') || this.canvas.getContext('experimental-webgl');
|
|
|
1012
|
+ var options = { preserveDrawingBuffer: this.preserveDrawingBuffer };
|
|
|
1013
|
+ gl = this.gl = this.canvas.getContext('webgl', options) || this.canvas.getContext('experimental-webgl', options);
|
|
1012
|
1014
|
} catch (e) {
|
|
1013
|
1015
|
return false;
|
|
1014
|
1016
|
}
|