forked from video-react/video-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: New ClosedCaptionButton component
- Loading branch information
Showing
22 changed files
with
2,334 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* eslint react/no-multi-comp: 0, react/prop-types: 0 */ | ||
import React from 'react'; | ||
import { PrismCode } from 'react-prism'; | ||
import Helmet from 'react-helmet'; | ||
import PlayerWithCaptions from '../examples/PlayerWithCaptions'; | ||
|
||
const PlayerWithCaptionsSource = require('!!raw-loader!../examples/PlayerWithCaptions'); | ||
|
||
export default function CaptionedVideoPage() { | ||
return ( | ||
<div> | ||
<Helmet title="PosterImage" /> | ||
<h3>ClosedCaptionButton</h3> | ||
<p> | ||
There is an example on how to add a ClosedCaption button component into{' '} | ||
<code>Video-React</code> Player. | ||
</p> | ||
<div className="docs-example"> | ||
<PlayerWithCaptions /> | ||
</div> | ||
<p /> | ||
<h4>ClosedCaptionButton</h4> | ||
<pre> | ||
<PrismCode className="language-jsx"> | ||
{PlayerWithCaptionsSource} | ||
</PrismCode> | ||
</pre> | ||
</div> | ||
); | ||
} |
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,67 @@ | ||
import React from 'react'; | ||
import { Player, ControlBar, ClosedCaptionButton } from 'video-react'; | ||
|
||
export default function PlayerWithCaptions() { | ||
return ( | ||
<Player videoId="video-1" autoPlay> | ||
<source | ||
src="//d2zihajmogu5jn.cloudfront.net/elephantsdream/ed_hd.mp4" | ||
type="video/mp4" | ||
/> | ||
<source | ||
src="//d2zihajmogu5jn.cloudfront.net/elephantsdream/ed_hd.ogg" | ||
type="video/ogg" | ||
/> | ||
|
||
<track | ||
kind="captions" | ||
src="/assets/elephantsdream/captions.en.vtt" | ||
srcLang="en" | ||
label="English" | ||
default | ||
/> | ||
<track | ||
kind="captions" | ||
src="/assets/elephantsdream/captions.sv.vtt" | ||
srcLang="sv" | ||
label="Swedish" | ||
/> | ||
<track | ||
kind="captions" | ||
src="/assets/elephantsdream/captions.ru.vtt" | ||
srcLang="ru" | ||
label="Russian" | ||
/> | ||
<track | ||
kind="captions" | ||
src="/assets/elephantsdream/captions.ja.vtt" | ||
srcLang="ja" | ||
label="Japanese" | ||
/> | ||
<track | ||
kind="captions" | ||
src="/assets/elephantsdream/captions.ar.vtt" | ||
srcLang="ar" | ||
label="Arabic" | ||
/> | ||
|
||
<track | ||
kind="descriptions" | ||
src="/assets/elephantsdream/descriptions.en.vtt" | ||
srcLang="en" | ||
label="English" | ||
/> | ||
|
||
<track | ||
kind="chapters" | ||
src="/assets/elephantsdream/chapters.en.vtt" | ||
srcLang="en" | ||
label="English" | ||
/> | ||
|
||
<ControlBar autoHide={false}> | ||
<ClosedCaptionButton order={7} /> | ||
</ControlBar> | ||
</Player> | ||
); | ||
} |
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
Oops, something went wrong.