mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Fixed video recording cache
The browser was storing the play recording request on cache . Adding a query parameter which is updated each time fix this problempull/803/head
parent
fffbdd3cd5
commit
f5e18fc11d
|
@ -19,7 +19,6 @@ export class RecordingService {
|
||||||
private recordingStatus = <BehaviorSubject<{ info: RecordingInfo; time?: Date } | undefined>>new BehaviorSubject(undefined);
|
private recordingStatus = <BehaviorSubject<{ info: RecordingInfo; time?: Date } | undefined>>new BehaviorSubject(undefined);
|
||||||
private baseUrl = '/' + (!!window.location.pathname.split('/')[1] ? window.location.pathname.split('/')[1] + '/' : '');
|
private baseUrl = '/' + (!!window.location.pathname.split('/')[1] ? window.location.pathname.split('/')[1] + '/' : '');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
@ -72,7 +71,10 @@ export class RecordingService {
|
||||||
const recordingId = recording.id;
|
const recordingId = recording.id;
|
||||||
// Only COMPOSED recording is supported. The extension will allways be 'mp4'.
|
// Only COMPOSED recording is supported. The extension will allways be 'mp4'.
|
||||||
const extension = 'mp4'; //recording.url?.split('.').pop() || 'mp4';
|
const extension = 'mp4'; //recording.url?.split('.').pop() || 'mp4';
|
||||||
this.actionService.openRecordingPlayerDialog(`${this.baseUrl}recordings/${recordingId}/${recordingId}.${extension}`);
|
const queryParamForAvoidCache = `?t=${new Date().getTime()}`;
|
||||||
|
this.actionService.openRecordingPlayerDialog(
|
||||||
|
`${this.baseUrl}recordings/${recordingId}/${recordingId}.${extension}${queryParamForAvoidCache}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -106,7 +108,7 @@ export class RecordingService {
|
||||||
this.recordingTime = new Date();
|
this.recordingTime = new Date();
|
||||||
this.recordingTime.setHours(0, 0, 0, 0);
|
this.recordingTime.setHours(0, 0, 0, 0);
|
||||||
this.recordingTimeInterval = setInterval(() => {
|
this.recordingTimeInterval = setInterval(() => {
|
||||||
if(this.recordingTime) {
|
if (this.recordingTime) {
|
||||||
this.recordingTime.setSeconds(this.recordingTime.getSeconds() + 1);
|
this.recordingTime.setSeconds(this.recordingTime.getSeconds() + 1);
|
||||||
this.recordingTime = new Date(this.recordingTime.getTime());
|
this.recordingTime = new Date(this.recordingTime.getTime());
|
||||||
this.recordingStatus.next({ info: this.currentRecording, time: this.recordingTime });
|
this.recordingStatus.next({ info: this.currentRecording, time: this.recordingTime });
|
||||||
|
|
Loading…
Reference in New Issue