Giter Site home page Giter Site logo

stream-react's Introduction

@cloudflare/stream-react

Official React component for Cloudflare Stream.

Installation

yarn add @cloudflare/stream-react

Usage

import { Stream } from "@cloudflare/stream-react";

export const App = () => {
  const videoIdOrSignedToken = "YOUR_VIDEO_ID_OR_SIGNED_TOKEN";
  return (
    <div>
      <Stream controls src={videoIdOrSignedToken} />
    </div>
  );
};

Props

export type StreamProps = {
  /**
   * Either the video UID or the signed token for the video you’ve uploaded to Cloudflare Stream should be included here.
   */
  src: string;
  /**
   * Ref for accessing the underlying Stream player API. Useful for providing imperative access:
   * https://developers.cloudflare.com/stream/viewing-videos/using-the-stream-player/using-the-player-api
   */
  streamRef?: MutableRefObject<StreamPlayerApi | undefined>;
  /**
   * URL to a VAST advertising tag. If specified, the player will attempt to display ads speficied by the VAST ad schema.
   */
  adUrl?: string;
  /**
   * The height of the video’s display area, in CSS pixels.
   */
  height?: string;
  /**
   * The width of the video’s display area, in CSS pixels.
   */
  width?: string;
  /**
   * 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.
   */
  poster?: string;
  /**
   * Tells the browser to immediately start downloading the video and play it as soon as it can. Note that mobile browsers generally do not support this attribute, the user must tap the screen to begin video playback. Please consider mobile users or users with Internet usage limits as some users don’t have unlimited Internet access before using this attribute.
   *
   * In addition, some browsers now prevent videos with audio from playing automatically. You may add the mute attribute to allow your videos to autoplay. For more information, [go here](https://webkit.org/blog/6784/new-video-policies-for-ios/).
   */
  autoplay?: boolean;
  /**
   * Shows the default video controls such as buttons for play/pause, volume controls. You may choose to build buttons and controls that work with the player.
   */
  controls?: boolean;
  /**
   * 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
   * the stream player which will seek every time the value is set.
   */
  currentTime?: number;
  /**
   * A Boolean attribute which indicates the default setting of the audio contained in the video. If set, the audio will be initially silenced.
   */
  muted?: boolean;
  /**
   * Any valid CSS color value provided will be applied to the letterboxing/pillarboxing of the player’s UI. This can be set to transparent to avoid letterboxing/pillarboxing when not in fullscreen mode.
   * https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
   */
  letterboxColor?: string;
  /**
   * A Boolean attribute; if included the player will automatically seek back to the start upon reaching the end of the video.
   */
  loop?: boolean;
  /**
   * 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.
   *
   * The <video> element does not force the browser to follow the value of this attribute; it is a mere hint. Even though the preload="none" option is a valid HTML5 attribute, Stream player will always load some metadata to initialize the player. The amount of data loaded in this case is negligable.
   */
  preload?: "auto" | "metadata" | "none" | boolean;
  /**
   * Any valid CSS color value provided will be applied to certain elements of the player's UI.
   * https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
   */
  primaryColor?: string;
  /**
   * A timestamp that specifies the time when playback begins.
   * If a plain number is used such as ?startTime=123, it will
   * be interpreted as 123 seconds. More human readable timestamps
   * can also be used, such as ?startTime=1h12m27s for 1 hour,
   * 12 minutes, and 27 seconds.
   */
  startTime?: string | number;
  /**
   * Automatically manages the aspect ratio of the iframe for you. Defaults to true. If you want to manually handle the styles yourself, set this to false.
   */
  responsive?: boolean;
  /**
   * Sets volume from 0.0 (silent) to 1.0 (maximum value)
   */
  volume?: number;
  /**
   * 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.
   */
  onAbort?: EventListener;
  /**
   * Sent when enough data is available that the media can be played, at least for a couple of frames.
   */
  onCanPlay?: EventListener;
  /**
   * Sent when the entire media can be played without interruption, assuming the download rate remains at least at the current level. It will also be fired when playback is toggled between paused and playing. Note: Manually setting the currentTime will eventually fire a canplaythrough event in firefox. Other browsers might not fire this event.
   */
  onCanPlayThrough?: EventListener;
  /**
   * The metadata has loaded or changed, indicating a change in duration of the media. This is sent, for example, when the media has loaded enough that the duration is known.
   */
  onDurationChange?: EventListener;
  /**
   * Sent when playback completes.
   */
  onEnded?: EventListener;
  /**
   * 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)
   */
  onError?: EventListener;
  /**
   * The first frame of the media has finished loading.
   */
  onLoadedData?: EventListener;
  /**
   * The media’s metadata has finished loading; all attributes now contain as much useful information as they’re going to.
   */
  onLoadedMetaData?: EventListener;
  /**
   * Sent when loading of the media begins.
   */
  onLoadStart?: EventListener;
  /**
   * Sent when the playback state is changed to paused (paused property is true).
   */
  onPause?: EventListener;
  /**
   * Sent when the playback state is no longer paused, as a result of the play method, or the autoplay attribute.
   */
  onPlay?: EventListener;
  /**
   * Sent when the media has enough data to start playing, after the play event, but also when recovering from being stalled, when looping media restarts, and after seeked, if it was playing before seeking.
   */
  onPlaying?: EventListener;
  /**
   * Sent periodically to inform interested parties of progress downloading the media. Information about the current amount of the media that has been downloaded is available in the media element’s buffered attribute.
   */
  onProgress?: EventListener;
  /**
   * Sent when the playback speed changes.
   */
  onRateChange?: EventListener;
  /**
   * Sent when a seek operation completes.
   */
  onSeeked?: EventListener;
  /**
   * Sent when a seek operation begins.
   */
  onSeeking?: EventListener;
  /**
   * Sent when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming.
   */
  onStalled?: EventListener;
  /**
   * Sent when loading of the media is suspended; this may happen either because the download has completed or because it has been paused for any other reason.
   */
  onSuspend?: EventListener;
  /**
   * The time indicated by the element’s currentTime attribute has changed.
   */
  onTimeUpdate?: EventListener;
  /**
   * Sent when the audio volume changes (both when the volume is set and when the muted attribute is changed).
   */
  onVolumeChange?: EventListener;
  /**
   * Sent when the requested operation (such as playback) is delayed pending the completion of another operation (such as a seek).
   */
  onWaiting?: EventListener;
  /**
   * Fires when ad-url attribute is present and the ad begins playback
   */
  onStreamAdStart?: EventListener;
  /**
   * Fires when ad-url attribute is present and the ad finishes playback
   */
  onStreamAdEnd?: EventListener;
  /**
   * Fires when ad-url attribute is present and the ad took too long to load.
   */
  onStreamAdTimeout?: EventListener;
};

stream-react's People

Contributors

dependabot[bot] avatar irvinebroque avatar javiermartinz avatar renandincer avatar serranoarevalo avatar supachaidev avatar theduc avatar third774 avatar xixa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stream-react's Issues

React Native Support

Any milestone to make this work with react native?


name: feature-request
about: Use this template to request new features.
title: 'Feature request'
labels: feature-request


403 status code doesn't trigger any EventListener

Hi, I have a Video that is only available for specific domains and which I don't have access to. For local development, I receive a 403 error because localhost is not whitelisted. If this happens, I want to skip the view and move to next. But no EventListener is triggered when this happens. I tried the following ones:

  • onAbort
  • onError
  • onStalled
  • onSuspend

Is there another way to handle this error? Tested on Chrome.

For some users the player automatically pauses after ~1 second of playback

On Mac OS + Chrome, for some users the player automatically pauses after 1-2 seconds of playback without any user interaction. The video does the same thing after seeking and seems to get stuck if the user seeks beyond what has been buffered. No JS errors appear in the console.

Opening the page in an incognito window or restarting the browser seems to help but this has happened to multiple people so it seems to be more than just a fluke. Might this be a sessionStorage issue?

Here's a video of the issue.

Screen.Recording.2021-08-31.at.13.29.48.mp4

We're using stream-react 1.2.0.

Responsive video gets cut off when using full screen API on parent element

I have a situation where I have the player wrapped in a parent div that the user can toggle full screen on, as in, not by using the fullscreen button in the player itself. This is so that other elements can be included in fullscreen mode. The lib I'm using for this is https://www.npmjs.com/package/react-full-screen.

The problem is that the aspect ratio doesn't get updated correctly which results in the video getting cut off on large screens.

It looks to be because of the padding-top on the iframe wrapper div.

Screen Shot 2022-04-15 at 14 33 12

Screen Shot 2022-04-15 at 14 33 36

Multiple rerenders before changing the videoId causes unknown error occured message

We found that on a large application, if react rerenders 3-7 times just after page load and the videoId changes inbetween, the player shows an unknown error message and continues to do so every time you change the videoId after that
this means that there's no way to recover from an error like this without unmounting the component and remounting it which isn't really a good solution

I created a reproducable repo here https://github.com/Floffah/cloudflare-stream-error and deployed it so you can test
Make sure to set your network tab to a slightly slower network throttling setting (e.g. Fast 3G)

Ref doesn't work

Hello Cloudflare team,

I've encountered a problem using this library. Ref's don't work as expected. It has value, but the properties are 0 and actions like pause or play don't affect the player. Here is a working demo.
next 13.4.12
react 18.2
@cloudflare/stream-react 1.8

Could you please have a look into this issue?

letterboxColor not supported

When using responsive I get 1px black borders at certain page widths:
CleanShot 2022-03-25 at 16 03 10@2x

I presume setting letterboxColor="white" would solve this, but I don't see that param supported in this lib. Can we add it in?

Update to latest Stream player

Hi 👋

Thanks for all your work on creating this React wrapper - much appreciated!

I've seen this post in the Cloudflare forum:

Major Stream Player changes rolling out Aug 3, 2020

Hello! I work on the Stream team and I wanted to share an upcoming Stream Player change that could impact developers who may be making customizations to the player DOM elements.

You can stop reading if you aren’t making changes to the contents of the element or if you only use the official player API 68. Similarly, if you use the official React or Angular components, this change will not affect you.
https://community.cloudflare.com/t/major-stream-player-changes-rolling-out-aug-3-2020/189844

and noticed that stream-react still uses:

const scriptLocation =
"https://embed.videodelivery.net/embed/r4xu.fla9.latest.js";

While the forum post speaks about: 3f8m.fla9.latest.js as the preview build, is there a specific reason why r4xu.fla9.latest.js is used instead of sdk.latest.js?


On the same note, would be great if the Player would also be open sourced. This would make the version numbers more obvious and allow people to contribute to it :)

Cheers

Event onRender

The event that fires when the stream player data is loaded fires before the poster and the controls show up. I'm trying to show a loading icon up until the player is fully rendered on the screen, but unable to do so. Which prop would handle this?

Apply `object-fit: cover` to the `<video/>` element

Currently, there does not seem to be a solution for filling the whole player viewport with the video provided (known as cover). The <video/> element cannot be styled since it's loaded in the <iframe/>.

401 on playerEnhancementInfo.json endpoint

Hi everyone,

sorry I this post doesn't meet the standards or patterns. I just developed my signed urls and everything works as expected but the endpoint https://videodelivery.net/2fa5ec943c53ac2928b511fea95abff2/metadata/playerEnhancementInfo.json response me with 401 status code.

What can be the cause of this? Should I be concerned? I would like free errors platform (hehe)

Thanks for all team!

Video Playback Issue in LINE In-App Browser

Hello Cloudflare Team,

I am experiencing an issue with the @cloudflare/stream-react library, specifically regarding video playback in the LINE app's in-app browser on Android devices.

Issue Description

The videos streamed using the @cloudflare/stream-react library fail to play only in the LINE in-app browser on Android.
These videos work perfectly on other platforms and browsers, including the LINE app on iOS.
No similar issues are observed in browsers like Chrome or Firefox on Android.

I would appreciate any insights, advice, or potential solutions you might have regarding this problem. Is there a known issue with Cloudflare Stream in LINE's in-app browser on Android, or are there specific settings I should consider?

Thank you for your assistance and looking forward to a resolution.

Remix Run Support?

I have tested the following plugin successfully with Gatsbyjs and Nextjs but unfortunately the plugin showing errors when using with Remix Run framework. The error only occur when I use Chrome Browser while click on fullscreen mode. Somehow other browsers such as Safari and Firefox no issues with fullscreen mode.

The error on chrome browser:
HTMLVideoElement.webkitEnterFullscreen() is deprecated. Please use Element.requestFullscreen() instead.

Some workaround and guide is appreciated.

Thank you,

Get back the player from videojs

Hello,

I wanted to use your stream component and extends it with some plugin.
To do that, I would need to get access to the player object.
With the props streamRef, I know I can get the dom element but I don't see how i could get him then use him afterward.

Thanks for the component by te way.

Add streamRef in props documentation

Hi Cloudflare Team,

Thank you so much for the great plugin! I really appreciate that this plugin works great out of the box. However, I would like to suggest adding the streamRef attribute as part of the documentation. This would be really helpful for future devs who would like to access the stream reference.

Once again, thanks so much!

Stream height

I have a div that contains a Stream component, I set the height of the div to 240px for mobile screens and 480px for large screens. The Stream component is rendered perfectly fit inside the div for large screens, but its height goes full screen for mobile screens (I tested on Chrome and Safari and they both have the same result). My question is how can we make the Stream height fit inside a div for mobile screens? Any suggestion?

How to hide this loader icon

Hello,
Quick question, how to hide this loader icon? I read the docs but I didn't find what I was looking for.
image

Thanks! :)

Video does not load

I use this component to load the player but the video does not load as expected. The component has an iframe linked to https://embed.videodelivery.net/embed/iframe.fla9.d42d30f.html?videoId=VIDEO_ID. Accessing the URL directly also resulted in blank white page.

This is the code I use to load the video

<Stream src={VIDEO_ID} width="100%" height="100%"></Stream>

Custom full-screen button

Hello all,

I'm using your player but I needed to create custom controls for it, and I'm a bit stuck with a full-screen (resize) button. I'm looking at the documentation and I only see width and height for resizing the video.

I have also poke around the code and I saw this part using the resize event.

  useEvent("resize", ref, () => {
    if (ref.current) {
      const { videoHeight, videoWidth } = ref.current;
      setVideoDimensions({ videoHeight, videoWidth });
      onResize && onResize();
    }
  });

Is this is the event for resizing the video? What will be the preferred way of doing this?

I have created a sandbox with some of the controls and I have added simple styling (sorry for poor CSS styling here 😄 ).

Cheers

Video is disappeared after fullscreen

When i'm using the default setup and enter fullscreen and then closes fullscreen the video is magically disappeared. I can still hear the sound.

Mac and chrome.

How can I access the video duration from the API?

So I'm using the Stream component in a straightforward way, here's a simplified version:

export default function ({ videoId }) {
  const streamRef = useRef<StreamPlayerApi>();
  const [volume, setVolume] = useState(100);

  return (
    <Stream
            src={videoId}
            streamRef={streamRef}
            currentTime={currentTime}
            volume={volume / 100}
            onLoadedData={(e) => console.log("onLoadedData", e)}
            onDurationChange={(e) => console.log("onDurationChange", e)}
            onLoadedMetaData={(e) => console.log("onLoadedMetaData", e)}
        />
  );
}

So I would like to have a way to access the duration of the video, either from the StreamPlayerApi, as for the volume, or as props from the LoadedMetaData or DurationChange events.
Is it possible?

The StreamPlayerApi type does not include a playbackRate property

Hello Cloudflare team

I am currently customizing the control part of the player, and I am facing an issue where the playbackRate property is not recognized as part of the StreamPlayerApi type

image

However, when I print out the instance of StreamPlayerApi, it does show that playbackRate exists

스크린샷 2023-12-02 14 02 30

I would appreciate it if you could modify the type definition to include this property!

Feature: Enable a mechanism to show/hide captions on-demand

Currently, there is a possibility to autoplay a muted video with a captions track shown. However, there is no way to, for instance, hide those captions if user disables muted.

Since the video is behind and iframe, there is no way to access to the tracks and hide them using something like

videoRef.textTracks[0].mode = 'hidden'

onEnded event not firing after video has completed

I've embedded the stream-react component into a React application in the following way:

<Stream
  preload
  controls
  streamRef={streamPlayerRef}
  src={myVideoID}
  onEnded={(event) => console.log(event)} // does not fire after the video finishes
  onTimeUpdate={(event) => console.log(event)} // other events work fine such as 'onTimeUpdate'
/>

And while I can play videos just fine, any onEnded event is not firing after finishing a video - and despite the fact that I can see the event handler registered to the DOM element. Instead, I see an endless loop of failed requests with a status code 404 in the dev console + my previous video being blacked out with a loading spinner on the top:

GET https://videodelivery.net/<redacted>/video/240/seg_497.ts?p=<redacted>&s=<redacted>
GET https://videodelivery.net/<redacted>/video/360/seg_497.ts?p=<redacted>&s=<redacted>
GET https://videodelivery.net/<redacted>/video/480/seg_497.ts?p=<redacted>&s=<redacted>
GET https://videodelivery.net/<redacted>/video/720/seg_497.ts?p=<redacted>&s=<redacted>

When I then look at the streamPlayerRef, I notice the following after finishing the video:

Question: is this a bug with the stream-react wrapper or does it perhaps have anything to do with using the free tier?


My environment:

"@cloudflare/stream-react": "^0.1.5",
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
"react-scripts": "^3.4.4",

node: v15.0.1
npm: 6.14.8

Video thumbnails don't load with preload "none"

I've noticed that I am unable to get video thumbnails to load without having the preload property set to at least metadata. With the metadata value, the thumbnail is loaded but a chunk of the video is also loaded causing unnecessary loading.

When using an iframe based include, this does not appear to happen. See the code below. This loads the thumbnail, and does not load any of the video until the user clicks play.

Is there a way to get this result using the stream component?

<div style={{ position: 'relative', paddingTop: '56.25%' }}>
        <iframe
          src={
            'https://iframe.videodelivery.net/' +
            props.cfStreamId +
            '?preload=none'
          }
          title='Video'
          style={{
            border: 'none',
            position: 'absolute',
            top: '0',
            height: '100%',
            width: '100%',
            left: '0',
          }}
          allow='accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture; fullscreen'
        ></iframe>
</div>

Thank you!

abr manager / selectVariantTrack() warning

Hello Cloudflare team,

Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().

I get a warning in the console for every video

SCR-20230707-rwc

Height And Width Don't seem to work

HI, when setting the height and the width in the player

 <Stream
          streamRef={ref}
          src={item.videoId}
          autoplay={true}
          muted={mute}
          controls={false}
          loop={true}
          onCanPlay={() => setPlaceHolder(false)}
          height="720"
          width="1280"
/>

the values don't seem to effect the size of the actual iframe thats rendered
while this is working when using the iframe directly, without using the react component

<iframe
        title="baba"
        src="https://iframe.videodelivery.net/3dc082cc5149aea41970edec72544bca?muted=true&preload=true&loop=true&autoplay=true&controls=false"
        style={{
          border: "none",
          position: "",
          top: "0",
          height: "100vh",
          width: "100vh",
        }}
        allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
        allowfullscreen="true"
      ></iframe> 

this will actually adapt the size of the iframe

Can't seek to the same location twice

Seeking to the same timestamp by setting currentTime only works the first time.

Reproduction:

const Player = ({url}) => {
  const [seekTime, setSeekTime] = React.useState<number>(0)

  return (
    <>
      <button onClick={() => setSeekTime(33)}>Seek</button>
      <Stream src={url} currentTime={seekTime} />
    </>
  )
}

Clicking the button the first time seeks, but clicking it a second time (with the video playing) has no effect. I can work around this by setting the currentTime twice (delaying the second using a timeout):

const seek = React.useCallback(
  (seekTo: number) => {
    setSeekTime(undefined)
    setTimeout(() => setSeekTime(seekTo), 1)
  },
  [setSeekTime]
)

As a side note, are the notes for the currentTime prop correct? It says

Returns the current playback time in seconds.

which I don't think is right?

'document' is not defined when importing Stream in Server Side Rendering

Hey everyone,

I'm unable to server-side render any apps that imports Stream because an error gets thrown: document is not defined. Looking into the source code, there's a line referring to global namespace, document, with no validation to check if global namespace document exists:
var scriptLocation = "https://embed.videodelivery.net/embed/r4xu.fla9.latest.js"; var streamScript = /*#__PURE__*/document.querySelector("script[src=\"" + scriptLocation + "\"]");

Ideally, I'd like to use the react module in my codebase as it is cleaner, but do you recommend I use the <iframe> code snippet in the app code instead of this module for SSR compatibility? Thanks in advance

how does customerCode work?

We cannot get customerCode prop to work at all. The video plays without it, which is strange. We are just copying the customer code that is used in the iframe on Cloudflare for the embed, but nothing we do works. The embed itself plays fine, so there is nothing wrong with the customer. Embed shows: customer-{customerCode}.cloudflarestream.com . We tried using customerCode value, but no luck. then we tried customer-customerCode. Still doesn't work. Then we just tried, customer-customerCode.cloudflarestream.com and still nothing. What are you supposed to use for this prop?

customerCode prop not documented

Hi,

The customerCode prop doesn't seem to be documented anywhere. I assume it should be in the list of required props, but it's not. I mean, it's surely a crucial thing to document, since without it how could the component ever build the final url?

Thanks

Accessibility: iframe title

The rendered iframe of the video component doesn't currently contain a title. It would be good to at a minimum expose a title property that can be set for accessibility.

<iframe
        ref={iframeRef}
        src={iframeSrc}
        style={responsive ? responsiveIframeStyles : undefined}
        frameBorder={0}
        height={height}
        width={width}
        allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
        allowFullScreen
      />

Play Icon is still on the screen after clicking "play" in Chrome and Firefox

Component is very good and suitable as out-of-the-box solution but there is a little bug that worsens UX. When I start to play live stream big play button is still on the screen even after clicking "play". It disappears after video starting. This bug is reproduced on Chrome and Firefox(mac os). In Safari everything is ok - after clicking play loader is shown.

Support for closed captions

We have a home spun version of the video client because we need support for closed captioning (specifically .vtt files). Is this feature planned for the official client?

SVG play icon not consistently displaying on iOS

Hey CF team – we're using @cloudflare/stream-react and we're seeing odd behavior on a handful of iOS/iPhone devices (we've tested a few).

The SVG play icon does not consistently load on iOS. When testing on other devices, e.g. Chrome w/ iOS emulator, it loads just fine. Not sure if this is an SVG rendering bug, but I did notice if I leave Safari iOS for a 10-15 seconds and come back, it eventually displays (long after initial pageload).

Here is a link to an example for easy repro:
https://get.doordash.com/en-us/products/merchant-portal#4SQyxBHt6fZliIluzKZOQw

image

Image from iOS

image

Thanks in advance!

poster prop is not declarative (does not update poster when URL changes)

Hello Cloudflare team,

We have a use case where we are using an external 'video picker' list to select a video they want to watch.

Once they click it, we update the props going to the <Stream> component, including the src and poster props.

The src prop seems to take effect, because starting the video does in fact play the selected video, however the poster does not change.

It looks like it's an intended behavior due to the useMemo implementation without dependencies here:

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

Which says you can use the SDK to make the changes... but I don't see how.

Thanks in advance - we're hoping to switch to Stream from a competitor but this is blocking our implementation :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.