Uploading video via media.upload() not working.
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- grpc, typescript
- Domain
- api
Research direction
Start with the media.upload() documentation and its supported media types, then reproduce the reported failures with the sample webm and mp4 uploads using the shown TypeScript call. Done means the supported video behavior is verified and either video uploads work as documented or the documentation accurately states their limitations.
Written by the indexing model from the issue text.
Description
I read in the docs that media.upload() supports uploading video types with not much documentation on filetypes, limits or any meaningful information on that.
So I tried adding video uploads to my App:
const uploadPromises = matches.map(async (match) => {
const dataUrl = match[1];
const mediaCategory = match[2];
const extension = match[3]?.toLowerCase();
let mediaType: 'gif' | 'image' | 'video' = 'image';
if (mediaCategory === 'video') {Z
mediaType = 'video';
} else if (extension === 'gif') {
mediaType = 'gif';
}
console.log('Uploading media:', { mediaType });
const response = await media.upload({ url: String(dataUrl), type: mediaType });
return { dataUrl: String(dataUrl), mediaUrl: response.mediaUrl };
});
const uploadResults = await Promise.all(uploadPromises);
for (const res of uploadResults) {
finalContent = finalContent.replace(res.dataUrl, res.mediaUrl);
}
However I tried uploading a sample webm file and it returns:
Failed to upload media: Error: 2 UNKNOWN: stream error: stream ID 10557; PROTOCOL_ERROR; received from peer
I also tried an mp4 file:
Failed to upload media: Error: 2 UNKNOWN: grpc invocation failed with status 2; unable to poll media URL https://i/. redd. it/xxxxx.mp4 failed to poll media after 5 polling timestamps
I tried different file sizes. Even at 900KB it fails. Not sure why this happens. Can anybody confirm if I am doing something wrong?
I am not sure if I am doing something wrong or not. Not even sure if video uploads is even supported and that docs might need updating.
If I am not doing it wrong then you either need to update docs removing video as supported mediaType to avoid confusion or add the support.
- Dominant language
- TypeScript
- Stars
- 217
- Forks
- 89
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from reddit/devvit
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
Bound concurrent filesystem reads during asset discovery and source ZIP generationPossibly taken @CR29-22-2805 claimed this 139 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Similar issues
-
bug data-types
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/clickhouse-js#1293 ·
Maintainers usually reply within 1 day
-
area: middleware enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
agent/quality testing
Difficulty 1/5 Under an hour Newbie friendliness 95/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
juspay/agent-distro#203 ·
Maintainers usually reply within 1 day