Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Netlify create mux signed urls

This app uses Netlify functions to create one Netlify endpoint that will 302 redirect to a signed MUX url


When this is deployed you can use a netlify function as the endpoint for your player src, either in a web player or a native player.

Web example

<video src="https://<your-netlify-project><playback-id>"></video>

iOS AVPlayer example

let url = URL(string: "https://<your-netlify-project><playback-id>")
player = AVPlayer(url: url!)

The netlify endpoint will 302 redirect to the signed URL

Example (dev)

  1. Run netlify dev in one terminal

netlify dev

You should see a local dev server running

  1. Run netlify-lambda in another terminal window

netlify-lambda server ./functions

You should see that netlify-lambda watches the ./functions directory and compiles changes into your build director (.netifly/.functions)

  1. Curl your local dev server
curl -I  'http://localhost:56348/.netlify/functions/sign_playback_id?playbackId=<playback-id>'

You should see a 302 (redirect) with a location header that is the full signed mux url:<playback-id>.m3u8?token=<token>


  1. Build using netlify-lambda and deploy with netlify deploy

netlify-lambda build ./functions` && netlify deploy --prod

You can’t perform that action at this time.