cloudflare / stream-react

BSD 3-Clause "New" or "Revised" License
164 stars 28 forks source link

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

Open danielthedifficult opened 1 year ago

danielthedifficult commented 1 year ago

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

third774 commented 1 year ago

Hey, thanks for reporting! We'll take a look at this soon! 🙏🏻