-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix custom player types + add react-player example (#242)
* example: add custom player. react-player * docs: add custom player demo * fix: player types & update readme
- Loading branch information
Showing
9 changed files
with
130 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Metadata } from 'next'; | ||
import Video from 'next-video'; | ||
import ReactPlayer from './player' | ||
import getStarted from '/videos/country-clouds.mp4'; | ||
|
||
export const metadata: Metadata = { | ||
title: 'next-video - Custom Player', | ||
}; | ||
|
||
export default function Page() { | ||
return ( | ||
<> | ||
<section> | ||
<Video as={ReactPlayer} src={getStarted} /> | ||
</section> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use client'; | ||
|
||
import type { PlayerProps } from 'next-video'; | ||
import ReactPlayer from 'react-player'; | ||
|
||
export default function Player(props: PlayerProps) { | ||
let { asset, src, poster, blurDataURL, thumbnailTime, ...rest } = props; | ||
let config = { file: { attributes: { poster } } }; | ||
|
||
return <ReactPlayer | ||
url={src} | ||
config={config} | ||
width="100%" | ||
height="100%" | ||
{...rest} | ||
/>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters