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
- 210
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
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 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:tools bug good first issue help wanted priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
TaewoooPark/Motifcode#14 ·
-
bug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·
-
Difficulty 2/5 Half a day Newbie friendliness 78/100
vercel/vercel-plugin#199 ·