Skip to content

Instantly share code, notes, and snippets.

@vasa-develop
Created October 5, 2019 10:00
Show Gist options
  • Save vasa-develop/1e9efed5f6cf8f58c95636d5ed79cd45 to your computer and use it in GitHub Desktop.
Save vasa-develop/1e9efed5f6cf8f58c95636d5ed79cd45 to your computer and use it in GitHub Desktop.
SimpleAsWater Tutorial - Youtube on IPFS
//TODO: Retrieve the Data from the IPFS peer using IPFS Gateway
videoSrc.src = `http://localhost:8080/ipfs/${videos[i].hash}`
{
hash: "QmbL8GTmeCuAJeaQeRaZb8uqZJbRnpDoYpyW51hB43UdTt",
path: "QmbL8GTmeCuAJeaQeRaZb8uqZJbRnpDoYpyW51hB43UdTt",
size: 11989385
}
<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>
//TODO: Initialize IPFS HTTP API
const ipfs = window.IpfsHttpClient('localhost', '5001')
//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