Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get asset ID or playback ID when upload is finished? #65

Closed
arcticmatt opened this issue Aug 28, 2021 · 10 comments
Closed

get asset ID or playback ID when upload is finished? #65

arcticmatt opened this issue Aug 28, 2021 · 10 comments

Comments

@arcticmatt
Copy link

I'm trying to do the following:

  1. User uploads video (from browser) using upchunk
  2. After the upload is complete, I want to display their video

This would be easy if upchunk gave me the asset ID or playback ID when the upload is finished. But as far as I can tell, it doesn't, and I need to add a webhook in order to get this functionality.

@mmcc
Copy link
Contributor

mmcc commented Aug 29, 2021

Totally see what you mean, but this is out of scope for UpChunk itself. This library is just for facilitating chunked resumable uploads and doesn't really know anything about Mux at all (or at least tries to stay agnostic). We're exploring higher-level components, though!

We typically suggest integrating with webhooks as a general best practice, but if it helps you can also get the asset ID via the direct upload endpoint. Once the upload is complete the direct upload object includes the newly created asset id. In stream.new we use a similar workflow and just hit the related upload/asset endpoints to ultimately show the player.

If you have other questions feel free to shoot an email to help@mux.com or jump on Intercom. I bumped an internal feature request on this one, I agree the upload workflow is a little convoluted right now, particularly when not using Webhooks 😞

@mmcc mmcc closed this as completed Aug 29, 2021
@danpalmieri
Copy link

This is disappointing! Receive the file id is the expected default workflow in 99% of apps.

@shahidbasheer
Copy link

shahidbasheer commented Mar 4, 2024

is there any api to get asset by passing the passthrough key?

@mmcc
Copy link
Contributor

mmcc commented Mar 5, 2024

@shahidbasheer No, the passthrough field can't be used as a filter or anything along those lines. You can filter the asset list with upload_id and live_stream_id.

@shahidbasheer
Copy link

thank you from creeate direct upload I got the upload id and fetch assets with that.

$upload = $uploadsApi->createDirectUpload($createUploadRequest); $url = $upload->getData()->getUrl(); $upload_id = $upload->getData()->getId();

@mmcc
Copy link
Contributor

mmcc commented Mar 5, 2024

Yep, that's what I would do too!

@aikonoer
Copy link

aikonoer commented Apr 6, 2024

no plans to simplifying it and just return asset id after upload?

@RubenStark
Copy link

But like whats the point, if I cant get the upload ID to play the video the user just upload, it just have no sense

@malithmcr
Copy link

why is this issue closed if you don't provide a proper solution?

@mmcc
Copy link
Contributor

mmcc commented Jul 27, 2024

I get where you’re coming from, but it’s simply not the level this library lives at. It’s a generic library anyone can use with a storage backend that accepts chunks. It only knows about an upload url, it does not, and cannot, know about your Mux asset details.

We have a full example that involves handling webhooks for this workflow in our docs.

We do want to provide higher level abstractions for this, but those would live in Mux-specific projects like Mux Uploader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants