Update Video Asset
This guide provides you the instructions to update a video asset from the Livepeer Studio Dashboard or through the Livepeer API.
The Livepeer API allows you to send video files to Livepeer and get them ready for optimized playback. Videos can be provided either by you (static content) or your users, given your application offers an interface for them to do so.
Step 1: Get the asset.id
of an existing asset
Get the asset.id
of an existing asset. An asset.id
can be found in the
response object of any API call working with assets. If you haven't created an
asset yet, you can follow the
upload a video asset guide to do so.
Step 2: Update the asset
Once you have an asset.id
, you can make a request to update the asset's name,
playback policy and storage.
- Livepeer.js
- Fetch
import { useUpdateAsset } from '@livepeer/react';
function App() {
const { mutate: updateAsset } = useUpdateAsset({
assetId,
name: 'testing123',
});
}
const updateAssetName = await fetch("https://livepeer.studio/api/asset/{id}", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.API_TOKEN}`,
"Content-Type": "application/json",
},
body: {
name: "testing123",
},
});