cloudflare / cloudflare/stream-react
poster prop is not declarative (does not update poster when URL changes)
- Ngôn ngữ chính
- TypeScript
- Star
- 198
- Fork
- 30
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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 :)
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách đọc src/useIframeSrc.tsx quanh các dòng 53-59, đặc biệt là hành vi useMemo được mô tả trong issue. Tái hiện trường hợp này bằng cách thay đổi prop poster của component Stream cùng với src, sau đó xác minh rằng poster đang được hiển thị được cập nhật khi URL thay đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- typescript
- Lĩnh vực
- frontend
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100