mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Used proxy for requesting the recording thumbnail
parent
6b27a44542
commit
dbf8a84981
|
@ -72,7 +72,7 @@
|
|||
(recording.properties.outputMode === 'COMPOSED' ||
|
||||
recording.properties.outputMode === 'COMPOSED_QUICK_START')
|
||||
"
|
||||
[src]="recording.thumbnailB64"
|
||||
[src]="recording.url | thumbnailUrl"
|
||||
/>
|
||||
<div class="video-btns">
|
||||
<button
|
||||
|
|
|
@ -18,7 +18,7 @@ import { DeleteDialogComponent } from './components/dialogs/delete-recording.com
|
|||
import { LinkifyPipe } from './pipes/linkify.pipe';
|
||||
import { TranslatePipe } from './pipes/translate.pipe';
|
||||
import { StreamTypesEnabledPipe, ParticipantStreamsPipe } from './pipes/participant.pipe';
|
||||
import { DurationFromSecondsPipe, SearchByStringPropertyPipe } from './pipes/recording.pipe';
|
||||
import { DurationFromSecondsPipe, SearchByStringPropertyPipe, ThumbnailFromUrlPipe } from './pipes/recording.pipe';
|
||||
|
||||
import { OpenViduAngularConfig } from './config/openvidu-angular.config';
|
||||
import { CdkOverlayContainer } from './config/custom-cdk-overlay';
|
||||
|
@ -102,6 +102,7 @@ const privateComponents = [
|
|||
ParticipantStreamsPipe,
|
||||
DurationFromSecondsPipe,
|
||||
SearchByStringPropertyPipe,
|
||||
ThumbnailFromUrlPipe,
|
||||
StreamTypesEnabledPipe,
|
||||
TranslatePipe
|
||||
],
|
||||
|
|
|
@ -50,3 +50,21 @@ export class SearchByStringPropertyPipe implements PipeTransform {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@Pipe({
|
||||
name: 'thumbnailUrl'
|
||||
})
|
||||
export class ThumbnailFromUrlPipe implements PipeTransform {
|
||||
transform(url: string): string {
|
||||
if(url.includes('.mp4')){
|
||||
const lastPart = url.split('/').pop();
|
||||
let thumbnailUrl = lastPart?.replace('mp4', 'jpg');
|
||||
thumbnailUrl = `recordings/${thumbnailUrl?.split('.')[0]}/${thumbnailUrl}`;
|
||||
return thumbnailUrl;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue