Created
October 5, 2019 10:00
-
-
Save vasa-develop/1e9efed5f6cf8f58c95636d5ed79cd45 to your computer and use it in GitHub Desktop.
SimpleAsWater Tutorial - Youtube on IPFS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Retrieve the Data from the IPFS peer using IPFS Gateway | |
videoSrc.src = `http://localhost:8080/ipfs/${videos[i].hash}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
hash: "QmbL8GTmeCuAJeaQeRaZb8uqZJbRnpDoYpyW51hB43UdTt", | |
path: "QmbL8GTmeCuAJeaQeRaZb8uqZJbRnpDoYpyW51hB43UdTt", | |
size: 11989385 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Youtube on IPFS - SimpleAsWater</title> | |
<link rel="stylesheet" | |
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" | |
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" | |
crossorigin="anonymous"> | |
<!-- Import JS IPFS CDN Link --> | |
<script src="https://unpkg.com/ipfs-http-client/dist/index.min.js"></script> | |
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Initialize IPFS HTTP API | |
const ipfs = window.IpfsHttpClient('localhost', '5001') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Upload Data to IPFS peer using IPFS HTTP API | |
const results = await ipfs.add(e.target.result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment