GithubHelp home page GithubHelp logo

Comments (2)

RizwanAslam avatar RizwanAslam commented on August 26, 2024 1

Hi @dylanjha, yup I got it now. Thank you very much for your quick response. Cheers

from upchunk.

dylanjha avatar dylanjha commented on August 26, 2024

Hi @RizwanAslam thanks for reaching out. Good question -- let me help clarify. The short answer is that after the upload success fires you will need to do one of two things:

  • Make a request from your client to your server and from your server make a request to Mux with the upload_id
  • Wait for the Mux Webhook video.upload.asset_created (more details here) -- this will contain the full upload object which will have an asset_id property.

^ Either of those methods is a valid approach.


It sounds like you understand this bit -- but to clarify the relationship between Mux Uploads and Mux Assets for anyone else that may come across this:

Mux Upload

  • This gets created on the serverside and gives you an "upload URL" by making the request: POST /uploads
  • The upload itself has several properties:id, url, status, new_asset_settings, error
  • Use the url property with Upchunk to perform the upload -- it sounds like you got this far
  • When the upload is complete, either GET /uploads/:id API Reference or listen for the video.upload.asset_created Webhooks
  • At this point in time now that the upload is complete, the upload will have an asset_id property.

Mux Asset

  • Use the asset_id property from the completed upload to fetch the asset
  • GET /assets/:id: API Reference
  • The asset itself has a status ("preparing", "ready", "errored"), playback_ids, aspect_ratio, an upload_id`, etc.
  • Be ready to handle all 3 statusus in your application. When the upload is complete the asset will start in the "preparing" state and assuming a valid video file as been uploaded then it will transition to "ready". If the file was not a video file, or happens to be invalid for another reason then the asset will be in the "errored" status.

Hopefully that clarifies the relationship between Uploads and Assets. Here's a guide that might be helpful too.

Let us know if you're still stuck and we'd be happy to help!

from upchunk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.