Video block: Videos can't be played in private sites #5497
Closed
Description
Describe the bug
Videos uploaded to private sites or videos marked as private can't be played in the editor via the Video block.
To Reproduce
- Go to a Simple site in WPCOM.
- Go to the Site Settings screen.
- Change Privacy to Private.
- Open a post/page.
- Add a Video block.
- Upload a video from the local device or record one.
- Once the upload finishes, tap on the video to play it.
- Observe that the video doesn't load and can't be played.
Expected behavior
Private videos should be playable within the Video block.
Screenshots
RPReplay_Final1677088758.MP4
Smartphone (please complete the following information):
- Device: iPhone 11
- OS: 15.4.1
- Version: Jetpack 21.7.0.0
Additional context
This issue is caused because videos uploaded to Simple and Atomic sites are also added to VideoPress. On iOS, when fetching the video item, we use the VideoPress URL provided by the videos
endpoint and the original
response parameter. However, for playing private videos, we also need to pass a query parameter metadata_token
with the token of that video. Otherwise, the request fails with error 403 Forbidden.
Metadata
Assignees
Labels
Type
Projects
Status
Done (keep clean, manually)