audio poster image

This commit is contained in:
Yiannis Christodoulou 2025-10-16 17:19:59 +03:00
parent 48e632c17f
commit 03d62909b4
5 changed files with 213 additions and 209 deletions

View File

@ -31,6 +31,9 @@ import PlaybackEventHandler from '../../utils/PlaybackEventHandler';
// Import sample media data // Import sample media data
import sampleMediaData from '../../../public/sample-media-file.json'; import sampleMediaData from '../../../public/sample-media-file.json';
// Import fallback poster image
import audioPosterImg from '../../../public/audio-poster.jpg';
// Function to enable tooltips for all standard VideoJS buttons // Function to enable tooltips for all standard VideoJS buttons
const enableStandardButtonTooltips = (player) => { const enableStandardButtonTooltips = (player) => {
// Wait a bit for all components to be initialized // Wait a bit for all components to be initialized
@ -1665,7 +1668,7 @@ function VideoJSPlayer({ videoId = 'default-video' }) {
? mediaData.siteUrl + mediaData.data.author_thumbnail ? mediaData.siteUrl + mediaData.data.author_thumbnail
: '', : '',
url: mediaData.data?.url || '', url: mediaData.data?.url || '',
poster: mediaData.data?.poster_url ? mediaData.siteUrl + mediaData.data.poster_url : '/audio-poster.jpg', poster: mediaData.data?.poster_url ? mediaData.siteUrl + mediaData.data.poster_url : audioPosterImg,
previewSprite: mediaData?.previewSprite || {}, previewSprite: mediaData?.previewSprite || {},
useRoundedCorners: mediaData?.useRoundedCorners, useRoundedCorners: mediaData?.useRoundedCorners,
isPlayList: mediaData?.isPlayList, isPlayList: mediaData?.isPlayList,

View File

@ -14,6 +14,7 @@ export default defineConfig({
}, },
}, },
root: path.resolve(__dirname, 'src'), root: path.resolve(__dirname, 'src'),
publicDir: path.resolve(__dirname, 'public'),
define: { define: {
'process.env': { 'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'production'), NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'production'),

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long