In the previous tutorial I showed how to upload images or videos to IPFS. You can upload it by following the tutorial.
To upload a file to your IPFS server, you must make an HTTP POST request to the server. a key whose value is a video file in the body of request must be defined.
Now I will upload Utopian.io - How to Contribute video to my IPFS server with Postman.
Successfully uploaded!
https://steemia.net/ipfs/QmPfeq2wm79gS5Ho4Jyasu5TLSoSewfs41kxLpGKiSRr6w
When you send an HTTP POST request, it will return the HASH of the file. When you send an HTTP POST request, it will return the HASH of the file. With this Hash you can access video via IPFS Gateway.
https://gateway.ipfs.io/ipfs/HASH
You can create an interactive video player with the video.js library to play the videos. Video.js is an extendable library around the native video element.
Let's start by creating an application with NodeJS starter pack.
Once you have created a NodeJS app, you will create two html pages for homepage and video review page. On the Index page, the user will enter the video hash and the video will be opened in a new page with the VideoJS player.
index.js
index.html
video.html to render videos
When you open to Home, an input will ask for Video hash. When you submit a video hash, you will access the video via the ipfs gateway, and video.js will be triggered to play the video.
I also deployed this nodejs application so you can easily test it. I uploaded Utopian Contribution Tutorial video to IPFS. You can use it to test video-ipfs app.
QmPfeq2wm79gS5Ho4Jyasu5TLSoSewfs41kxLpGKiSRr6w