File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1256,13 +1256,16 @@ export class TethrSigma extends TethrPTPUSB {
1256
1256
}
1257
1257
1258
1258
#canvasMediaStream = new CanvasMediaStream ( )
1259
+ #liveviewStream: MediaStream | null = null
1259
1260
1260
1261
async startLiveview ( ) : Promise < OperationResult < MediaStream > > {
1261
1262
const stream = await this . #canvasMediaStream. begin (
1262
1263
this . #updateLiveviewFrame
1263
1264
)
1264
1265
this . device . on ( 'idle' , this . #updateLiveviewFrame)
1265
1266
1267
+ this . #liveviewStream = stream
1268
+
1266
1269
this . emit ( 'liveviewChange' , readonlyConfigDesc ( stream ) )
1267
1270
1268
1271
return { status : 'ok' , value : stream }
@@ -1278,10 +1281,16 @@ export class TethrSigma extends TethrPTPUSB {
1278
1281
this . #canvasMediaStream. updateWithImage ( bitmap )
1279
1282
}
1280
1283
1284
+ async getLiveview ( ) : Promise < MediaStream | null > {
1285
+ return this . #liveviewStream
1286
+ }
1287
+
1281
1288
async stopLiveview ( ) : Promise < OperationResult > {
1282
1289
this . #canvasMediaStream. end ( )
1283
1290
this . device . off ( 'idle' , this . #updateLiveviewFrame)
1284
1291
1292
+ this . #liveviewStream = null
1293
+
1285
1294
this . emit ( 'liveviewChange' , readonlyConfigDesc ( null ) )
1286
1295
1287
1296
return { status : 'ok' }
You can’t perform that action at this time.
0 commit comments