photo: add delay to live playback
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/900/head
parent
1e5a5d3b4f
commit
543646624a
|
@ -119,6 +119,7 @@ export default defineComponent({
|
|||
|
||||
data: () => ({
|
||||
touchTimer: 0,
|
||||
playLiveTimer: 0,
|
||||
faceSrc: null as string | null,
|
||||
}),
|
||||
|
||||
|
@ -144,6 +145,7 @@ export default defineComponent({
|
|||
/** Clear timers */
|
||||
beforeDestroy() {
|
||||
clearTimeout(this.touchTimer);
|
||||
clearTimeout(this.playLiveTimer);
|
||||
|
||||
// Clean up blob url if face rect was created
|
||||
if (this.faceSrc) {
|
||||
|
@ -269,7 +271,11 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
/** Start preview video */
|
||||
async playVideo() {
|
||||
playVideo() {
|
||||
utils.setRenewingTimeout(
|
||||
this,
|
||||
'playLiveTimer',
|
||||
async () => {
|
||||
const video = this.refs.video;
|
||||
if (!video || this.data.flag & this.c.FLAG_SELECTED) return;
|
||||
|
||||
|
@ -280,9 +286,13 @@ export default defineComponent({
|
|||
// ignore, pause was probably called too soon
|
||||
}
|
||||
},
|
||||
400,
|
||||
);
|
||||
},
|
||||
|
||||
/** Stop preview video */
|
||||
stopVideo() {
|
||||
window.clearTimeout(this.playLiveTimer);
|
||||
this.refs.video?.pause();
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue