Skip to content

Commit d674fac

Browse files
committed
Update video id and signed url verbiage
1 parent b94d54b commit d674fac

4 files changed

Lines changed: 12 additions & 9 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const App = () => {
2828
```ts
2929
export type StreamProps = {
3030
/**
31-
* Either the video id or the signed url for the video you’ve uploaded to Cloudflare Stream should be included here.
31+
* Either the video UID or the signed token for the video you’ve uploaded to Cloudflare Stream should be included here.
3232
*/
3333
src: string;
3434
/**
@@ -142,7 +142,7 @@ export type StreamProps = {
142142
*/
143143
onEnded?: EventListener;
144144
/**
145-
* Sent when an error occurs. (e.g. the video has not finished encoding yet, or the video fails to load due to an incorrect signed URL)
145+
* Sent when an error occurs. (e.g. the video has not finished encoding yet, or the video fails to load due to an invalid signed token)
146146
*/
147147
onError?: EventListener;
148148
/**

src/Stream.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ export const StreamEmbed: FC<StreamProps> = ({
163163
startTime,
164164
});
165165

166-
// While it's easier for most consumers to simply provide the video id
167-
// or signed URL and have us compute the iframe's src for them, some
166+
// While it's easier for most consumers to simply provide the video UID
167+
// or signed token and have us compute the iframe's src for them, some
168168
// consumers may need to manually specify the iframe's src.
169169
const iframeSrc = validSrcUrl(src) ? src : computedSrc;
170170

src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export interface StreamPlayerApi {
103103
*/
104104
removeEventListener: (event: string, handler: EventListener) => void;
105105
/**
106-
* Either the video id or the signed url for the video you’ve uploaded to Cloudflare Stream should be included here.
106+
* Either the video UID or the signed token for the video you’ve uploaded to Cloudflare Stream should be included here.
107107
*/
108108
src: string;
109109
/**
@@ -198,7 +198,7 @@ export interface StreamProps {
198198
*/
199199
responsive?: boolean;
200200
/**
201-
* Either the video id or the signed url for the video you’ve uploaded to Cloudflare Stream should be included here.
201+
* Either the video UID or the signed token for the video you’ve uploaded to Cloudflare Stream should be included here.
202202
*/
203203
src: string;
204204
/**
@@ -252,7 +252,7 @@ export interface StreamProps {
252252
*/
253253
onEnded?: EventListener;
254254
/**
255-
* Sent when an error occurs. (e.g. the video has not finished encoding yet, or the video fails to load due to an incorrect signed URL)
255+
* Sent when an error occurs. (e.g. the video has not finished encoding yet, or the video fails to load due to an invalid signed token)
256256
*/
257257
onError?: EventListener;
258258
/**

src/useIframeSrc.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function useIframeSrc(
3030
adUrl,
3131
startTime,
3232
defaultTextTrack,
33-
customerCode
33+
customerCode,
3434
}: IframeSrcOptions
3535
) {
3636
const paramString = [
@@ -51,7 +51,10 @@ export function useIframeSrc(
5151
.join("&");
5252

5353
const iframeSrc = useMemo(
54-
() => customerCode ? `https://customer-${customerCode}.cloudflarestream.com/${src}?${paramString}` : `https://iframe.cloudflarestream.com/${src}?${paramString}`,
54+
() =>
55+
customerCode
56+
? `https://customer-${customerCode}.cloudflarestream.com/${src}?${paramString}`
57+
: `https://iframe.cloudflarestream.com/${src}?${paramString}`,
5558
// we intentionally do NOT include paramString here because we want
5659
// to avoid changing the URL when these options change. Changes to
5760
// these options will instead be handled separately via the SDK.

0 commit comments

Comments
 (0)