You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat!: replace Mux player w/ Media Chrome + media (#303)
* feat: replace Mux player w/ Media Chrome + media
* fix: slotted poster image
* fix: upgrade pkgs
* fix: add custom theme prop and example
* fix: upgrade Media Chrome
* fix: use Sutro as default
* docs: add default player docs
* fix: add hls-video, dash-video. src adapting types
* fix: test fixture
* docs: update readme
* site: fix active link
* docs: move change player theme to guides section
* docs: make more clear it's on the Video comp
* fix: use @mux/mux-video/react pkg
### Player only ([Demo](https://next-video-demo.vercel.app/player-only))
210
226
211
227
Since [`v1.1.0`](https://github.com/muxinc/next-video/releases/tag/v1.1.0) you can import the player component directly and use it without any upload and processing features.
@@ -483,6 +499,62 @@ export { handler as default } from '@/next-video';
483
499
```
484
500
485
501
502
+
## Default Player
503
+
504
+
The default player is built with [Media Chrome](https://github.com/muxinc/media-chrome).
505
+
506
+
- The default theme is [Sutro](https://player.style/themes/sutro) by Mux.
507
+
- The video engine changes automatically based on the source format:
508
+
- Video files (like MP4, MP3, WEBM) that are progressively downloaded are played with the native `<video>` element.
509
+
- Mux videos are played with [`<mux-video>`](https://github.com/muxinc/elements/tree/main/packages/mux-video).
510
+
- HLS streams are played with [`<hls-video>`](https://github.com/muxinc/media-elements/tree/main/packages/hls-video-element).
511
+
- DASH streams are played with [`<dash-video>`](https://github.com/muxinc/media-elements/tree/main/packages/dash-video-element).
512
+
513
+
### Props
514
+
515
+
The `<Video>` component accepts all the props of the `<video>` element and the following additional props:
516
+
517
+
-`src` (Asset | string): The video asset object (import) or source URL.
518
+
-`poster` (StaticImageData | string): A placeholder image for the video. (Auto generated for Mux videos)
519
+
-`blurDataURL` (string): A base64 image source URL that can be used as a placeholder. (Auto generated for Mux videos)
520
+
-`theme` (React Component): The player theme component. See [player.style](https://player.style/) for more themes.
521
+
-`as` (React Component): A custom player component. See [Custom player](#custom-player-demo).
522
+
-`transform` (function): A custom function to transform the asset object (src and poster).
523
+
-`loader` (function): A custom function used to resolve string based video URLs (not imports).
524
+
525
+
#### Mux video props
526
+
527
+
The `<Video>` component with a Mux video source accepts the following additional props:
528
+
529
+
-`startTime` (number): The start time of the video in seconds.
530
+
-`streamType` ("on-demand" | "live"): The stream type of the video. Default is "on-demand".
531
+
-`customDomain` (string): Assigns a custom domain to be used for Mux Video.
532
+
-`beaconCollectionDomain` (string): Assigns a custom domain to be used for Mux Data collection. NOTE: Must be set before playbackId to apply to Mux Data monitoring.
533
+
-`envKey` (string): This is the environment key for Mux Data. If you use Mux video this is automatically
534
+
set for you. If you use a different provider you can set this to your own key.
535
+
-`disableTracking` (boolean): Disables Mux data tracking of video playback.
536
+
-`disableCookies` (boolean): Disables cookies used by Mux Data.
537
+
-`preferPlayback` ("mse" | "native"): Specify if `<mux-video>` should try to use Media Source Extension or native playback (if available). If no value is provided, `<mux-video>` will choose based on what's deemed optimal for content and playback environment.
538
+
-`maxResolution` ("720p" | "1080p" | "1440p" | "2160p"): Specify the maximum resolution you want delivered for this video.
539
+
-`minResolution` ("480p" | "540p" | "720p" | "1080p" | "1440p" | "2160p"): Specify the minimum resolution you want delivered for this video.
540
+
-`programStartTime` (number): Apply PDT-based [instant clips](https://docs.mux.com/guides/create-instant-clips) to the beginning of the media stream.
541
+
-`programEndTime` (number): Apply PDT-based [instant clips](https://docs.mux.com/guides/create-instant-clips) to the end of the media stream.
542
+
-`assetStartTime` (number): Apply media timeline-based [instant clips](https://docs.mux.com/guides/create-instant-clips) to the beginning of the media stream.
543
+
-`assetEndTime` (number): Apply media timeline-based [instant clips](https://docs.mux.com/guides/create-instant-clips) to the end of the media stream.
544
+
-`renditionOrder` (string): Change the order in which renditions are provided in the src playlist. Can impact initial segment loads. Currently only support "desc" for descending order.
545
+
-`metadataVideoId` (string): This is an arbitrary ID sent to Mux Data that should map back to a record of this video in your database.
546
+
-`metadataTitle` (string): This is an arbitrary title for your video that will be passed in as metadata into Mux Data. Adding a title will give you useful context in your Mux Data dashboard. (optional, but encouraged)
547
+
-`metadataViewerUserId` (string): If you have a logged-in user, this should be an anonymized ID value that maps back to the user in your database that will be sent to Mux Data. Take care to not expose personal identifiable information like names, usernames or email addresses. (optional, but encouraged)
548
+
-`metadata*` (string): This metadata* syntax can be used to pass any arbitrary Mux Data metadata fields.
549
+
-`playbackToken` (string): The playback token for signing the `src` URL.
550
+
-`thumbnailToken` (string): The token for signing the `poster` URL.
551
+
-`storyboardToken` (string): The token for signing the storyboard URL.
552
+
-`drmToken` (string): The token for signing DRM license and related URLs.
553
+
-`targetLiveWindow` (number): An offset representing the seekable range for live content, where `Infinity` means the entire live content is seekable (aka "standard DVR"). Used along with `streamType` to determine what UI/controls to show.
554
+
-`liveEdgeOffset` (number): The earliest playback time that will be treated as playing "at the live edge" for live content.
555
+
-`debug` (boolean): Enables debug mode for the underlying playback engine (currently hls.js) and mux-embed, providing additional information in the console.
0 commit comments