Cannot get Media Preview Thumbnail to render #764
-
Hi Media Chrome folks 👋 The problemI'm running into some issues getting the "Media Preview Thumbnail" images to appear when the user hovers over the media time range. When I hover over the time range, the small badge showing the current time appears, but not the "Preview Thumbnail" I am on version Attempt 1 - Render the MediaPrevewThumbnail component with mediaPreviewImage and mediaPreviewCoords propsI saw in the Media Chrome docs (here) that I can render import { MediaPreviewThumbnail } from 'media-chrome/dist/react';
<MediaPreviewThumbnail
mediaPreviewImage="https://image.mux.com/A3VXy02VoUinw01pwyomEO3bHnG4P32xzV7u1j1FSzjNg/storyboard.vtt"
mediaPreviewCoords="284 640 284 160"
/> I have tried it with and without the No preview image appeared 😢 Attempt 2 - Render the MediaPrevewThumbnail but put the mediaPreviewImage props on the MediaController<MediaController
autohide={autohide} // https://www.media-chrome.org/en/media-controller#autohide
className={sizeClasses}
defaultStreamType={defaultStreamType} // https://www.media-chrome.org/en/media-controller#default-stream-type
ref={mediaControllerRef}
style={{
'--media-control-background': 'transparent',
'--media-control-hover-background': 'transparent',
'--media-control-padding': '0',
}}
nohotkeys
// ADD mediaPreviewImage PROP TO MEDIA CONTROLLER BELOW
mediaPreviewImage="https://image.mux.com/A3VXy02VoUinw01pwyomEO3bHnG4P32xzV7u1j1FSzjNg/storyboard.vtt"
mediaPreviewCoords="284 640 284 160"
>
<MediaPreviewThumbnail /> No preview image appeared 😢 Attempt 3 - Render a element inside the video elementI saw in these docs that you could render a Here was my code: <video
className="w-full h-full"
crossOrigin="anonymous"
muted={initiallyMuted}
playsInline
poster={loadingImageSrc}
ref={videoRef}
slot="media"
>
<track
default
label="thumbnails"
kind="metadata"
src="https://image.mux.com/A3VXy02VoUinw01pwyomEO3bHnG4P32xzV7u1j1FSzjNg/storyboard.vtt"
/>
</video> No preview image appeared in this case either 😢 Attempt 4 - Adding a
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Any chance you could put a reproduction online? It should be option 3, that's correct. |
Beta Was this translation helpful? Give feedback.
-
Hi @luwes 👋 Of course, here is a small codesandbox that reproduces the issue. Does anything jump out at you as wrong in terms of how I'm rendering the EDIT: I added some When I add |
Beta Was this translation helpful? Give feedback.
-
Ah yes, crossOrigin is required. Great you found the issue! |
Beta Was this translation helpful? Give feedback.
Hi @luwes 👋
Of course, here is a small codesandbox that reproduces the issue.
Does anything jump out at you as wrong in terms of how I'm rendering the
<track />
element?EDIT:
I added some
console.logs
and found that the track element did not have anycues
. So this line in controller.js was aborting early.When I add
crossOrigin="anonymous"
to the parent video component, it works A-okay!