@cloudflare/stream-react
Advanced tools
Comparing version 1.8.0 to 1.9.0
@@ -51,6 +51,7 @@ 'use strict'; | ||
startTime = _ref.startTime, | ||
defaultTextTrack = _ref.defaultTextTrack; | ||
defaultTextTrack = _ref.defaultTextTrack, | ||
customerCode = _ref.customerCode; | ||
var paramString = [poster && "poster=" + encodeURIComponent(poster), adUrl && "ad-url=" + encodeURIComponent(adUrl), defaultTextTrack && "defaultTextTrack=" + encodeURIComponent(defaultTextTrack), primaryColor && "primaryColor=" + encodeURIComponent(primaryColor), letterboxColor && "letterboxColor=" + encodeURIComponent(letterboxColor), startTime && "startTime=" + startTime, muted && "muted=true", preload && "preload=" + preload, loop && "loop=true", autoplay && "autoplay=true", !controls && "controls=false"].filter(Boolean).join("&"); | ||
var iframeSrc = React.useMemo(function () { | ||
return "https://iframe.cloudflarestream.com/" + src + "?" + paramString; | ||
return customerCode ? "https://customer-" + customerCode + ".cloudflarestream.com/" + src + "?" + paramString : "https://iframe.cloudflarestream.com/" + src + "?" + paramString; | ||
}, // we intentionally do NOT include paramString here because we want | ||
@@ -144,2 +145,3 @@ // to avoid changing the URL when these options change. Changes to | ||
var src = _ref2.src, | ||
customerCode = _ref2.customerCode, | ||
adUrl = _ref2.adUrl, | ||
@@ -166,2 +168,4 @@ _ref2$controls = _ref2.controls, | ||
volume = _ref2$volume === void 0 ? 1 : _ref2$volume, | ||
_ref2$playbackRate = _ref2.playbackRate, | ||
playbackRate = _ref2$playbackRate === void 0 ? 1 : _ref2$playbackRate, | ||
startTime = _ref2.startTime, | ||
@@ -210,2 +214,3 @@ streamRef = _ref2.streamRef, | ||
var computedSrc = useIframeSrc(src, { | ||
customerCode: customerCode, | ||
muted: muted, | ||
@@ -222,4 +227,4 @@ preload: preload, | ||
startTime: startTime | ||
}); // While it's easier for most consumers to simply provide the video id | ||
// or signed URL and have us compute the iframe's src for them, some | ||
}); // While it's easier for most consumers to simply provide the video UID | ||
// or signed token and have us compute the iframe's src for them, some | ||
// consumers may need to manually specify the iframe's src. | ||
@@ -237,3 +242,4 @@ | ||
useProperty("letterboxColor", ref, letterboxColor); | ||
useProperty("volume", ref, volume); // instantiate API after properties are bound because we want undefined | ||
useProperty("volume", ref, volume); | ||
useProperty("playbackRate", ref, playbackRate); // instantiate API after properties are bound because we want undefined | ||
// values to be set before defining the properties | ||
@@ -240,0 +246,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),o=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,r="https://embed.cloudflarestream.com/embed/sdk.latest.js",n=function(){if("undefined"!=typeof window)return window.Stream};function a(){var e=t.useState(n),o=e[0],a=e[1];return t.useEffect((function(){if(!o){var e=document.querySelector("script[src='"+r+"']"),t=null!=e?e:document.createElement("script");t.addEventListener("load",(function(){a(n)})),e||(t.src=r,document.head.appendChild(t))}}),[o]),o}function i(e,o,r){t.useEffect((function(){o.current&&(o.current[e]=r)}),[e,r,o])}function d(e,o,r){void 0===r&&(r=l),t.useEffect((function(){if(o.current){var t=o.current;return t.addEventListener(e,r),function(){return t.removeEventListener(e,r)}}}),[r,e,o])}var l=function(){},u={position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%"},s=function(e){var r=e.children,n=e.responsive,a=e.className,i=e.videoDimensions,d=i.videoHeight,l=i.videoWidth,u=t.useMemo((function(){return{position:"relative",paddingTop:l>0?d/l*100+"%":void 0}}),[l,d]);return o.createElement("div",{className:a,style:n?u:void 0},r)},c=function(e){var r=e.src,a=e.adUrl,l=e.controls,c=void 0!==l&&l,m=e.muted,p=void 0!==m&&m,f=e.autoplay,v=void 0!==f&&f,h=e.loop,g=void 0!==h&&h,y=e.preload,C=void 0===y?"metadata":y,T=e.primaryColor,S=e.letterboxColor,E=e.defaultTextTrack,b=e.height,x=e.width,w=e.poster,R=e.currentTime,U=void 0===R?0:R,k=e.volume,W=void 0===k?1:k,L=e.startTime,P=e.streamRef,D=e.responsive,H=void 0===D||D,j=e.className,I=e.title,A=e.onAbort,M=e.onCanPlay,N=e.onCanPlayThrough,q=e.onDurationChange,z=e.onEnded,B=e.onError,O=e.onLoadedData,_=e.onLoadedMetaData,F=e.onLoadStart,K=e.onPause,V=e.onPlay,G=e.onPlaying,J=e.onProgress,Q=e.onRateChange,X=e.onResize,Y=e.onSeeked,Z=e.onSeeking,$=e.onStalled,ee=e.onSuspend,te=e.onTimeUpdate,oe=e.onVolumeChange,re=e.onWaiting,ne=e.onStreamAdStart,ae=e.onStreamAdEnd,ie=e.onStreamAdTimeout,de=t.useRef(),le=null!=P?P:de,ue=t.useState({videoHeight:0,videoWidth:0}),se=ue[0],ce=ue[1],me=t.useRef(null),pe=function(e,o){var r=o.muted,n=o.preload,a=o.loop,i=o.autoplay,d=o.controls,l=o.poster,u=o.primaryColor,s=o.letterboxColor,c=o.adUrl,m=o.startTime,p=o.defaultTextTrack,f=[l&&"poster="+encodeURIComponent(l),c&&"ad-url="+encodeURIComponent(c),p&&"defaultTextTrack="+encodeURIComponent(p),u&&"primaryColor="+encodeURIComponent(u),s&&"letterboxColor="+encodeURIComponent(s),m&&"startTime="+m,r&&"muted=true",n&&"preload="+n,a&&"loop=true",i&&"autoplay=true",!d&&"controls=false"].filter(Boolean).join("&");return t.useMemo((function(){return"https://iframe.cloudflarestream.com/"+e+"?"+f}),[])}(r,{muted:p,preload:C,loop:g,autoplay:v,controls:c,poster:w,primaryColor:T,letterboxColor:S,adUrl:a,defaultTextTrack:E,startTime:L}),fe=function(e){try{var t=new URL(e);return t.hostname.endsWith("videodelivery.net")||t.hostname.endsWith("cloudflarestream.com")}catch(e){return!1}}(r)?r:pe;return i("muted",le,p),i("controls",le,c),i("src",le,r),i("autoplay",le,v),i("currentTime",le,U),i("loop",le,g),i("preload",le,C),i("primaryColor",le,T),i("letterboxColor",le,S),i("volume",le,W),t.useEffect((function(){var e=n();if(me.current&&e){var t=e(me.current);le.current=t;var o=t.videoHeight,r=t.videoWidth;o&&r&&ce({videoHeight:o,videoWidth:r})}}),[]),d("abort",le,A),d("canplay",le,M),d("canplaythrough",le,N),d("durationchange",le,q),d("ended",le,z),d("error",le,B),d("loadeddata",le,O),d("loadedmetadata",le,_),d("loadstart",le,F),d("pause",le,K),d("play",le,V),d("playing",le,G),d("progress",le,J),d("ratechange",le,Q),d("seeked",le,Y),d("seeking",le,Z),d("stalled",le,$),d("suspend",le,ee),d("timeupdate",le,te),d("volumechange",le,oe),d("waiting",le,re),d("stream-adstart",le,ne),d("stream-adend",le,ae),d("stream-adtimeout",le,ie),d("resize",le,(function(e){if(le.current){var t=le.current;ce({videoHeight:t.videoHeight,videoWidth:t.videoWidth}),X&&X(e)}})),o.createElement(s,{className:j,responsive:H,videoDimensions:se},o.createElement("iframe",{ref:me,src:fe,title:I,style:H?u:void 0,frameBorder:0,height:b,width:x,allow:"accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;",allowFullScreen:!0}))};exports.Stream=function(e){return a()?o.createElement(c,Object.assign({},e)):null},exports.useStreamSDK=a; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),o=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,r="https://embed.cloudflarestream.com/embed/sdk.latest.js",n=function(){if("undefined"!=typeof window)return window.Stream};function a(){var e=t.useState(n),o=e[0],a=e[1];return t.useEffect((function(){if(!o){var e=document.querySelector("script[src='"+r+"']"),t=null!=e?e:document.createElement("script");t.addEventListener("load",(function(){a(n)})),e||(t.src=r,document.head.appendChild(t))}}),[o]),o}function i(e,o,r){t.useEffect((function(){o.current&&(o.current[e]=r)}),[e,r,o])}function d(e,o,r){void 0===r&&(r=l),t.useEffect((function(){if(o.current){var t=o.current;return t.addEventListener(e,r),function(){return t.removeEventListener(e,r)}}}),[r,e,o])}var l=function(){},u={position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%"},s=function(e){var r=e.children,n=e.responsive,a=e.className,i=e.videoDimensions,d=i.videoHeight,l=i.videoWidth,u=t.useMemo((function(){return{position:"relative",paddingTop:l>0?d/l*100+"%":void 0}}),[l,d]);return o.createElement("div",{className:a,style:n?u:void 0},r)},c=function(e){var r=e.src,a=e.customerCode,l=e.adUrl,c=e.controls,m=void 0!==c&&c,p=e.muted,f=void 0!==p&&p,v=e.autoplay,h=void 0!==v&&v,y=e.loop,g=void 0!==y&&y,C=e.preload,T=void 0===C?"metadata":C,S=e.primaryColor,b=e.letterboxColor,E=e.defaultTextTrack,R=e.height,x=e.width,k=e.poster,w=e.currentTime,U=void 0===w?0:w,W=e.volume,L=void 0===W?1:W,P=e.playbackRate,D=void 0===P?1:P,H=e.startTime,j=e.streamRef,I=e.responsive,A=void 0===I||I,M=e.className,N=e.title,q=e.onAbort,z=e.onCanPlay,B=e.onCanPlayThrough,O=e.onDurationChange,_=e.onEnded,F=e.onError,K=e.onLoadedData,V=e.onLoadedMetaData,G=e.onLoadStart,J=e.onPause,Q=e.onPlay,X=e.onPlaying,Y=e.onProgress,Z=e.onRateChange,$=e.onResize,ee=e.onSeeked,te=e.onSeeking,oe=e.onStalled,re=e.onSuspend,ne=e.onTimeUpdate,ae=e.onVolumeChange,ie=e.onWaiting,de=e.onStreamAdStart,le=e.onStreamAdEnd,ue=e.onStreamAdTimeout,se=t.useRef(),ce=null!=j?j:se,me=t.useState({videoHeight:0,videoWidth:0}),pe=me[0],fe=me[1],ve=t.useRef(null),he=function(e,o){var r=o.muted,n=o.preload,a=o.loop,i=o.autoplay,d=o.controls,l=o.poster,u=o.primaryColor,s=o.letterboxColor,c=o.adUrl,m=o.startTime,p=o.defaultTextTrack,f=o.customerCode,v=[l&&"poster="+encodeURIComponent(l),c&&"ad-url="+encodeURIComponent(c),p&&"defaultTextTrack="+encodeURIComponent(p),u&&"primaryColor="+encodeURIComponent(u),s&&"letterboxColor="+encodeURIComponent(s),m&&"startTime="+m,r&&"muted=true",n&&"preload="+n,a&&"loop=true",i&&"autoplay=true",!d&&"controls=false"].filter(Boolean).join("&");return t.useMemo((function(){return f?"https://customer-"+f+".cloudflarestream.com/"+e+"?"+v:"https://iframe.cloudflarestream.com/"+e+"?"+v}),[])}(r,{customerCode:a,muted:f,preload:T,loop:g,autoplay:h,controls:m,poster:k,primaryColor:S,letterboxColor:b,adUrl:l,defaultTextTrack:E,startTime:H}),ye=function(e){try{var t=new URL(e);return t.hostname.endsWith("videodelivery.net")||t.hostname.endsWith("cloudflarestream.com")}catch(e){return!1}}(r)?r:he;return i("muted",ce,f),i("controls",ce,m),i("src",ce,r),i("autoplay",ce,h),i("currentTime",ce,U),i("loop",ce,g),i("preload",ce,T),i("primaryColor",ce,S),i("letterboxColor",ce,b),i("volume",ce,L),i("playbackRate",ce,D),t.useEffect((function(){var e=n();if(ve.current&&e){var t=e(ve.current);ce.current=t;var o=t.videoHeight,r=t.videoWidth;o&&r&&fe({videoHeight:o,videoWidth:r})}}),[]),d("abort",ce,q),d("canplay",ce,z),d("canplaythrough",ce,B),d("durationchange",ce,O),d("ended",ce,_),d("error",ce,F),d("loadeddata",ce,K),d("loadedmetadata",ce,V),d("loadstart",ce,G),d("pause",ce,J),d("play",ce,Q),d("playing",ce,X),d("progress",ce,Y),d("ratechange",ce,Z),d("seeked",ce,ee),d("seeking",ce,te),d("stalled",ce,oe),d("suspend",ce,re),d("timeupdate",ce,ne),d("volumechange",ce,ae),d("waiting",ce,ie),d("stream-adstart",ce,de),d("stream-adend",ce,le),d("stream-adtimeout",ce,ue),d("resize",ce,(function(e){if(ce.current){var t=ce.current;fe({videoHeight:t.videoHeight,videoWidth:t.videoWidth}),$&&$(e)}})),o.createElement(s,{className:M,responsive:A,videoDimensions:pe},o.createElement("iframe",{ref:ve,src:ye,title:N,style:A?u:void 0,frameBorder:0,height:R,width:x,allow:"accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;",allowFullScreen:!0}))};exports.Stream=function(e){return a()?o.createElement(c,Object.assign({},e)):null},exports.useStreamSDK=a; | ||
//# sourceMappingURL=stream-react.cjs.production.min.js.map |
@@ -44,6 +44,7 @@ import React, { useState, useEffect, useMemo, useRef } from 'react'; | ||
startTime = _ref.startTime, | ||
defaultTextTrack = _ref.defaultTextTrack; | ||
defaultTextTrack = _ref.defaultTextTrack, | ||
customerCode = _ref.customerCode; | ||
var paramString = [poster && "poster=" + encodeURIComponent(poster), adUrl && "ad-url=" + encodeURIComponent(adUrl), defaultTextTrack && "defaultTextTrack=" + encodeURIComponent(defaultTextTrack), primaryColor && "primaryColor=" + encodeURIComponent(primaryColor), letterboxColor && "letterboxColor=" + encodeURIComponent(letterboxColor), startTime && "startTime=" + startTime, muted && "muted=true", preload && "preload=" + preload, loop && "loop=true", autoplay && "autoplay=true", !controls && "controls=false"].filter(Boolean).join("&"); | ||
var iframeSrc = useMemo(function () { | ||
return "https://iframe.cloudflarestream.com/" + src + "?" + paramString; | ||
return customerCode ? "https://customer-" + customerCode + ".cloudflarestream.com/" + src + "?" + paramString : "https://iframe.cloudflarestream.com/" + src + "?" + paramString; | ||
}, // we intentionally do NOT include paramString here because we want | ||
@@ -137,2 +138,3 @@ // to avoid changing the URL when these options change. Changes to | ||
var src = _ref2.src, | ||
customerCode = _ref2.customerCode, | ||
adUrl = _ref2.adUrl, | ||
@@ -159,2 +161,4 @@ _ref2$controls = _ref2.controls, | ||
volume = _ref2$volume === void 0 ? 1 : _ref2$volume, | ||
_ref2$playbackRate = _ref2.playbackRate, | ||
playbackRate = _ref2$playbackRate === void 0 ? 1 : _ref2$playbackRate, | ||
startTime = _ref2.startTime, | ||
@@ -203,2 +207,3 @@ streamRef = _ref2.streamRef, | ||
var computedSrc = useIframeSrc(src, { | ||
customerCode: customerCode, | ||
muted: muted, | ||
@@ -215,4 +220,4 @@ preload: preload, | ||
startTime: startTime | ||
}); // While it's easier for most consumers to simply provide the video id | ||
// or signed URL and have us compute the iframe's src for them, some | ||
}); // While it's easier for most consumers to simply provide the video UID | ||
// or signed token and have us compute the iframe's src for them, some | ||
// consumers may need to manually specify the iframe's src. | ||
@@ -230,3 +235,4 @@ | ||
useProperty("letterboxColor", ref, letterboxColor); | ||
useProperty("volume", ref, volume); // instantiate API after properties are bound because we want undefined | ||
useProperty("volume", ref, volume); | ||
useProperty("playbackRate", ref, playbackRate); // instantiate API after properties are bound because we want undefined | ||
// values to be set before defining the properties | ||
@@ -233,0 +239,0 @@ |
@@ -75,2 +75,6 @@ import { MutableRefObject } from "react"; | ||
/** | ||
* A `double` that indicates the rate at which the media is being played back. | ||
*/ | ||
playbackRate: number; | ||
/** | ||
* An object conforming to the TimeRanges interface. This object is normalized, which means that ranges are ordered, don’t overlap, aren’t empty, and don’t touch (adjacent ranges are folded into one bigger range). | ||
@@ -99,3 +103,3 @@ */ | ||
/** | ||
* Either the video id or the signed url for the video you’ve uploaded to Cloudflare Stream should be included here. | ||
* Either the video UID or the signed token for the video you’ve uploaded to Cloudflare Stream should be included here. | ||
*/ | ||
@@ -144,2 +148,7 @@ src: string; | ||
/** | ||
* Use unique subdomain for iframe source | ||
* customer-<CODE>.cloudflarestream.com | ||
*/ | ||
customerCode?: string; | ||
/** | ||
* Will initialize the player with the specified text track enabled. The value should be the BCP-47 language code that was used to [upload the text track](https://developers.cloudflare.com/stream/uploading-videos/adding-captions). | ||
@@ -167,2 +176,6 @@ * Note: This will _only_ work once during initialization. Beyond that point the user has full control over their text track settings. | ||
/** | ||
* A `double` that indicates the rate at which the media is being played back. | ||
*/ | ||
playbackRate?: number; | ||
/** | ||
* A URL for an image to be shown before the video is started or while the video is downloading. If this attribute isn’t specified, a thumbnail image of the video is shown. | ||
@@ -187,3 +200,3 @@ */ | ||
/** | ||
* Either the video id or the signed url for the video you’ve uploaded to Cloudflare Stream should be included here. | ||
* Either the video UID or the signed token for the video you’ve uploaded to Cloudflare Stream should be included here. | ||
*/ | ||
@@ -201,3 +214,3 @@ src: string; | ||
* Ref for accessing the underlying stream element. Useful for providing imperative access to the player API: | ||
* https://developers.cloudflare.com/stream/viewing-videos/using-the-player-api | ||
* https://developers.cloudflare.com/stream/viewing-videos/using-the-stream-player/using-the-player-api | ||
*/ | ||
@@ -243,3 +256,3 @@ streamRef?: MutableRefObject<StreamPlayerApi | undefined>; | ||
/** | ||
* 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) | ||
* 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) | ||
*/ | ||
@@ -246,0 +259,0 @@ onError?: EventListener; |
@@ -14,4 +14,5 @@ import { Preload } from "./types"; | ||
preload?: Preload; | ||
customerCode?: string; | ||
} | ||
export declare function useIframeSrc(src: string, { muted, preload, loop, autoplay, controls, poster, primaryColor, letterboxColor, adUrl, startTime, defaultTextTrack, }: IframeSrcOptions): string; | ||
export declare function useIframeSrc(src: string, { muted, preload, loop, autoplay, controls, poster, primaryColor, letterboxColor, adUrl, startTime, defaultTextTrack, customerCode, }: IframeSrcOptions): string; | ||
export {}; |
{ | ||
"name": "@cloudflare/stream-react", | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"license": "BSD-3-Clause", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
@@ -31,3 +31,3 @@ # @cloudflare/stream-react | ||
/** | ||
* Either the video id or the signed url for the video you’ve uploaded to Cloudflare Stream should be included here. | ||
* Either the video UID or the signed token for the video you’ve uploaded to Cloudflare Stream should be included here. | ||
*/ | ||
@@ -37,3 +37,3 @@ src: string; | ||
* Ref for accessing the underlying Stream player API. Useful for providing imperative access: | ||
* https://developers.cloudflare.com/stream/viewing-videos/using-the-player-api | ||
* https://developers.cloudflare.com/stream/viewing-videos/using-the-stream-player/using-the-player-api | ||
*/ | ||
@@ -68,2 +68,7 @@ streamRef?: MutableRefObject<StreamPlayerApi | undefined>; | ||
/** | ||
* Use unique subdomain for iframe source | ||
* customer-<CODE>.cloudflarestream.com | ||
*/ | ||
customerCode?: string; | ||
/** | ||
* Setting this value seeks the video to a new time. Note that seeking only occurs when a new value is set. If this is problematic for your use-case, consider using the streamRef prop to set the currentTime directly on | ||
@@ -87,2 +92,6 @@ * the stream player which will seek every time the value is set. | ||
/** | ||
* A `double` that indicates the rate at which the media is being played back. | ||
*/ | ||
playbackRate?: number; | ||
/** | ||
* This enumerated attribute is intended to provide a hint to the browser about what the author thinks will lead to the best user experience. You may choose to include this attribute as a boolean attribute without a value, or you may specify the value preload="auto" to preload the beginning of the video. Not including the attribute or using preload="metadata" will just load the metadata needed to start video playback when requested. | ||
@@ -115,2 +124,7 @@ * | ||
/** | ||
* Will initialize the player with the specified text track enabled. The value should be the BCP-47 language code that was used to [upload the text track](https://developers.cloudflare.com/stream/uploading-videos/adding-captions). | ||
* Note: This will _only_ work once during initialization. Beyond that point the user has full control over their text track settings. | ||
*/ | ||
defaultTextTrack?: string; | ||
/** | ||
* Sent when playback is aborted; for example, if the media is playing and is restarted from the beginning, this event is sent. | ||
@@ -136,3 +150,3 @@ */ | ||
/** | ||
* 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) | ||
* 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) | ||
*/ | ||
@@ -139,0 +153,0 @@ onError?: EventListener; |
@@ -79,2 +79,6 @@ import { MutableRefObject } from "react"; | ||
/** | ||
* A `double` that indicates the rate at which the media is being played back. | ||
*/ | ||
playbackRate: number; | ||
/** | ||
* An object conforming to the TimeRanges interface. This object is normalized, which means that ranges are ordered, don’t overlap, aren’t empty, and don’t touch (adjacent ranges are folded into one bigger range). | ||
@@ -103,3 +107,3 @@ */ | ||
/** | ||
* Either the video id or the signed url for the video you’ve uploaded to Cloudflare Stream should be included here. | ||
* Either the video UID or the signed token for the video you’ve uploaded to Cloudflare Stream should be included here. | ||
*/ | ||
@@ -149,2 +153,7 @@ src: string; | ||
/** | ||
* Use unique subdomain for iframe source | ||
* customer-<CODE>.cloudflarestream.com | ||
*/ | ||
customerCode?: string; | ||
/** | ||
* Will initialize the player with the specified text track enabled. The value should be the BCP-47 language code that was used to [upload the text track](https://developers.cloudflare.com/stream/uploading-videos/adding-captions). | ||
@@ -172,2 +181,6 @@ * Note: This will _only_ work once during initialization. Beyond that point the user has full control over their text track settings. | ||
/** | ||
* A `double` that indicates the rate at which the media is being played back. | ||
*/ | ||
playbackRate?: number; | ||
/** | ||
* A URL for an image to be shown before the video is started or while the video is downloading. If this attribute isn’t specified, a thumbnail image of the video is shown. | ||
@@ -192,3 +205,3 @@ */ | ||
/** | ||
* Either the video id or the signed url for the video you’ve uploaded to Cloudflare Stream should be included here. | ||
* Either the video UID or the signed token for the video you’ve uploaded to Cloudflare Stream should be included here. | ||
*/ | ||
@@ -206,3 +219,3 @@ src: string; | ||
* Ref for accessing the underlying stream element. Useful for providing imperative access to the player API: | ||
* https://developers.cloudflare.com/stream/viewing-videos/using-the-player-api | ||
* https://developers.cloudflare.com/stream/viewing-videos/using-the-stream-player/using-the-player-api | ||
*/ | ||
@@ -248,3 +261,3 @@ streamRef?: MutableRefObject<StreamPlayerApi | undefined>; | ||
/** | ||
* 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) | ||
* 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) | ||
*/ | ||
@@ -251,0 +264,0 @@ onError?: EventListener; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
137251
1624
222