Skip to content

Commit 4090992

Browse files
committed
Added ability to set disableRemotePlayback
1 parent a0d60fc commit 4090992

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

docs/pages/cldvideoplayer/configuration.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,13 @@ import Table from '../../components/Table';
299299
description: (<span><strong>Check Cloudinary Video Player Api Docs</strong></span>),
300300
example: (<span><strong>Check Cloudinary Video Api Docs</strong></span>)
301301
},
302+
{
303+
prop: 'disableRemotePlayback',
304+
type: 'boolean',
305+
default: 'false',
306+
description: 'Disable the ability to use remote playback (cast video) on the video element',
307+
example: () => (<code>true</code>)
308+
},
302309
{
303310
prop: 'loop',
304311
type: 'boolean',

docs/pages/cldvideoplayer/examples.mdx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,34 @@ Utilizes the browser's Picture-in-Picture API to create a floating video on top
111111
```
112112
</CodeBlock>
113113

114+
### Disable Remote Playback
115+
116+
Prevents the video from being cast to remote devices by disabling the remote playback feature.
117+
118+
<HeaderImage>
119+
<CldVideoPlayer
120+
id="disable-remote-playback"
121+
width="2048"
122+
height="1080"
123+
src={`${process.env.VIDEOS_DIRECTORY}/dog-running-snow`}
124+
disableRemotePlayback
125+
/>
126+
</HeaderImage>
127+
128+
<CodeBlock>
129+
```jsx copy showLineNumbers
130+
import { CldVideoPlayer } from 'next-cloudinary';
131+
132+
<CldVideoPlayer
133+
id="disable-remote-playback"
134+
width="1620"
135+
height="1080"
136+
src="<Your Public ID>"
137+
disableRemotePlayback
138+
/>
139+
```
140+
</CodeBlock>
141+
114142
## Player Customization
115143

116144
### Chapters & Selector

next-cloudinary/src/components/CldVideoPlayer/CldVideoPlayer.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const CldVideoPlayer = (props: CldVideoPlayerProps) => {
1717
const {
1818
className,
1919
config,
20+
disableRemotePlayback,
2021
height,
2122
id,
2223
onDataLoad,
@@ -134,6 +135,7 @@ const CldVideoPlayer = (props: CldVideoPlayerProps) => {
134135
className={playerClassName}
135136
width={width}
136137
height={height}
138+
disableRemotePlayback={disableRemotePlayback}
137139
/>
138140
<Script
139141
id={`cloudinary-videoplayer-${playerId}`}

next-cloudinary/src/components/CldVideoPlayer/CldVideoPlayer.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { GetCldVideoUrlOptions } from '../../helpers/getCldVideoUrl';
1111
export type CldVideoPlayerProps = Omit<GetVideoPlayerOptions, "cloud_name" | "autoplayMode" | "publicId" | "secure" | "showLogo" | "logoImageUrl" | "logoOnclickUrl"> & {
1212
className?: string;
1313
config?: ConfigOptions;
14+
disableRemotePlayback?: boolean;
1415
id?: string;
1516
logo?: boolean | CldVideoPlayerPropsLogo;
1617
onDataLoad?: Function;

0 commit comments

Comments
 (0)