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) { while (i < socialMedia.length) {
switch (socialMedia[i]) { switch (socialMedia[i]) {
case 'embed': 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]] = {}; ret[socialMedia[i]] = {};
} }
break; break;

View File

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

View File

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