There are a bunch of ways to stream video from DDC:
<video>
tag, or Media SDKMore information on how both use cases work can be found here.
<video>
tag, or Media SDKTo upload the video file you need to pass the onboarding in the Cluster Management and create a bucket.
Assuming you already have a bucket and account, you need to prepare the JSON file ddc.config.json
with the configuration:
Testnet:
Mainnet:
Now you can use the terminal command below to upload the file:
Once the file is uploaded you will see the metadata:
Now you can construct the URL:
Testnet:
https://cdn.testnet.cere.network/<YOUR_BUCKET_ID>/<YOUR_CID>
Mainnet:
https://cdn.dragon.cere.network/<YOUR_BUCKET_ID>/<YOUR_CID>
Stream this video directly in the browser - just insert it to the browser, and you should be able to see the Video streamed directly from DDC.
<video>
tagInsert the code below to your HTML page:
Testnet:
<video src="https://cdn.testnet.cere.network/<YOUR_BUCKET_ID>/<YOUR_CID>"></video>
Mainnet:
<video src="https://cdn.dragon.cere.network/<YOUR_BUCKET_ID>/<YOUR_CID>"></video>
Install Media SDK to your project:
Add the code below to your ReactJS application to stream the video:
First of all, you need to Mint NFT and upload the content.
Open Freeport Creator Suite. Select NFT minter and Creator Suite
.
You need to have a Metamask extension at this point, to proceed.
In the top right menu: My Account → Mint NFT.
First, you need to mint Collection and then - enter your NFT information and attach the video file:
After the token is minted and the file is processed and stored in DDC, let’s integrate with the Media SDK:
Install the media SDK, using command below:
You need to wrap your ReactJS application with the provider:
Then you can use the Encrypted Video Player to stream the video:
You also can use Cere Wallet to create a signer instance for the Encrypted Video Player. Check this guide.