feat: Embed also audio .mp3 files

This commit is contained in:
Yiannis Christodoulou 2025-09-29 10:52:44 +03:00
parent 2d9594eb50
commit 3d1a4dd6d6
3 changed files with 5 additions and 3 deletions

View File

@ -17,7 +17,7 @@ function shareOptionsList() {
while (i < socialMedia.length) {
switch (socialMedia[i]) {
case 'embed':
if ('video' === MediaPageStore.get('media-data').media_type) {
if ('video' === MediaPageStore.get('media-data').media_type || 'audio' === MediaPageStore.get('media-data').media_type) {
ret[socialMedia[i]] = {};
}
break;

View File

@ -54,7 +54,7 @@ export class _VideoMediaPage extends Page {
}
onMediaLoad() {
const isVideoMedia = 'video' === MediaPageStore.get('media-type');
const isVideoMedia = 'video' === MediaPageStore.get('media-type') || 'audio' === MediaPageStore.get('media-type');
if (isVideoMedia) {
this.onViewerModeChange = this.onViewerModeChange.bind(this);

View File

@ -185,6 +185,8 @@ class MediaPageStore extends EventEmitter {
switch (this.get('media-type')) {
case 'video':
case 'audio':
this.emit('loaded_video_data');
break;
case 'image':
this.emit('loaded_' + this.get('media-type') + '_data');
break;
@ -607,7 +609,7 @@ class MediaPageStore extends EventEmitter {
}
isVideo() {
return 'video' === this.get('media-type');
return 'video' === this.get('media-type') || 'audio' === this.get('media-type');
}
onPlaylistCreationCompleted(response) {