Skip to content

Commit

Permalink
feat-#222: disableRemotePlayback for CldVideoPlayer
Browse files Browse the repository at this point in the history
  • Loading branch information
Baroshem committed Jun 24, 2024
1 parent 7c0384a commit ce32838
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 22 deletions.
1 change: 1 addition & 0 deletions docs/content/2.components/CldVideoPlayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Adding a button to select chapters (you can pass `chapters` prop as a boolean if
| pictureInPictureToogle | boolean | - | Enable Picture in Picture mode | true |
| chaptersButton | boolean | - | Enable Chapters button | true |
| chapters | object/boolean | - | Chapters configuration | { 0: 'Chapter 1', 6: 'Chapter 2', 9: 'Chapter 3' } |
| disableRemotePlayback | boolean | - | Indicate if media element may have a remote playback UI | true |

## Colors Prop

Expand Down
54 changes: 32 additions & 22 deletions playground/app.vue
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
<script lang="ts" setup>
// Usage of `useCldImageUrl` composable
const { url } = useCldImageUrl({ options: { src: "/cld-sample-5.jpg" } });
console.log(url);
const { url } = useCldImageUrl({ options: { src: '/cld-sample-5.jpg' } })
console.log(url)
const { url: videoUrl } = useCldVideoUrl({
options: { src: "videos/mountain-stars" },
});
console.log(videoUrl);
options: { src: 'videos/mountain-stars' },
})
console.log(videoUrl)
const mediaAssets = [
{ tag: "electric_car_product_gallery_demo" }, // by default mediaType: "image"
{ tag: "electric_car_product_gallery_demo", mediaType: "video" },
{ tag: "electric_car_360_product_gallery_demo", mediaType: "spin" },
];
{ tag: 'electric_car_product_gallery_demo' }, // by default mediaType: "image"
{ tag: 'electric_car_product_gallery_demo', mediaType: 'video' },
{ tag: 'electric_car_360_product_gallery_demo', mediaType: 'spin' },
]
const buttonId = "open-btn";
const buttonId = 'open-btn'
const cldVideoRef = ref();
const cldVideoRef = ref()
const chapters = {
0: "Chapter 1",
6: "Chapter 2",
9: "Chapter 3",
};
0: 'Chapter 1',
6: 'Chapter 2',
9: 'Chapter 3',
}
const colors = {
accent: "#ff0000",
base: "#00ff00",
text: "#0000ff",
};
accent: '#ff0000',
base: '#00ff00',
text: '#0000ff',
}
</script>

<template>
<button :id="buttonId">Select Image or Video</button>
<button :id="buttonId">
Select Image or Video
</button>
<CldMediaLibrary
api-key="12345"
:button-id="buttonId"
Expand All @@ -43,7 +45,10 @@ const colors = {
cloud-name="demo"
:button-id="buttonId"
/>
<CldOgImage src="cld-sample-2" twitter-title="test" />
<CldOgImage
src="cld-sample-2"
twitter-title="test"
/>
<CldVideoPlayer
ref="cldVideoRef"
width="1620"
Expand All @@ -60,7 +65,12 @@ const colors = {
upload-preset="nuxt-cloudinary-unsigned"
:tags="['sad', 'music']"
>
<button type="button" @click="open">Upload an Image</button>
<button
type="button"
@click="open"
>
Upload an Image
</button>
</CldUploadWidget>
<CldUploadButton upload-preset="nuxt-cloudinary-unsigned">
Upload
Expand Down
2 changes: 2 additions & 0 deletions src/runtime/components/CldVideoPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface CloudinaryVideoPlayerOptions {
pictureInPictureToggle?: boolean
chapters?: Record<string | number, string> | boolean
chaptersButton?: boolean
disableRemotePlayback?: boolean
}
export interface CloudinaryVideoPlayerOptionsColors {
Expand Down Expand Up @@ -244,6 +245,7 @@ useHead({
:class="playerClassName"
:width="width"
:height="height"
:disableRemotePlayback="disableRemotePlayback"
/>
</div>
</template>

0 comments on commit ce32838

Please sign in to comment.