cloudflare / cloudflare/stream-react

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

Open
#87 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
198
Forks
30
PR merge metrics
No merged PRs in 30d

Description

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 `` 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:
https://github.com/cloudflare/stream-react/blob/fda143fde6e235706ae14afc9dc919a11374c15b/src/useIframeSrc.tsx#L53-L59

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 :)

Contributor guide

Open the contributing guide

Research direction

Start by reading src/useIframeSrc.tsx around lines 53-59, especially the useMemo behavior described in the issue. Reproduce the case by changing the Stream component's poster prop alongside src, then verify that the displayed poster updates when the URL changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.