Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add video-on-demand player for recorded talks #79

Merged
merged 6 commits into from
Sep 30, 2018
Merged

Conversation

benhylau
Copy link
Member

Copied live player files over and made some minimal changes to get an embedded VOD player. See notes for actual changes, we can definitely organize the files better to avoid code duplication. This relies on https://ipfs.io infrastructure to stream.

vod-player


var ipfs_gateway_self = 'https://ipfs.io'; // IPFS gateway of this node
var ipfs_gateway_origin = 'https://ipfs.io'; // IPFS gateway of origin stream
var m3u8_ipfs = 'https://ipfs.io/ipfs/QmZJ5ZbJTfhQXM57PSWYy1VsHRDfL5AckjXy6W7RmP89AX'; // File path to m3u8 with IPFS content via HTTP server
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is hard coded to Opening Talk QmZJ5ZbJTfhQXM57PSWYy1VsHRDfL5AckjXy6W7RmP89AX here, but I imagine we can make a list with all pinned hashes, and have the list below the player change this property.

@garrying @dcwalk does that sound reasonable to do?

</div>

<script src="/js/vendor/video.min.js?{{site.time | date: '%s%N'}}"></script>
<script src="/js/vod-stream-embed.js?{{site.time | date: '%s%N'}}"></script>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/live/vod is the only change in this file.

function ipfsStream() {
live.src({
src: m3u8_ipfs,
type: 'video/mp4'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type is changed to video/mp4 here and above.

videojs.options.hls.overrideNative = true;
}

function httpStream() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can pass a raw http stream from Internet Archive?

@dcwalk
Copy link
Member

dcwalk commented Sep 26, 2018

I was imagining a smaller embed under each video, rather than a player on the page that all were fed into. If folks wanted to "click in" then the behaviour could be to redirect them to the standing player page (that way we only have a single "player" page?)

Also, the list of hashes is mocked up as being part of the session file currently.

@benhylau
Copy link
Member Author

Between many players on a page vs. linking out to a player page, I definitely prefer the latter.

Modifying the player to support both live and vod should be reasonably easy. I can give it a shot but would definitely like a review from @garrying

@benhylau
Copy link
Member Author

benhylau commented Sep 27, 2018

IPFS only:
http://localhost:4000/stream/?ipfs=QmZJ5ZbJTfhQXM57PSWYy1VsHRDfL5AckjXy6W7RmP89AX

IPFS + HTTP stream:
http://localhost:4000/stream/?ipfs=QmZJ5ZbJTfhQXM57PSWYy1VsHRDfL5AckjXy6W7RmP89AX&http=https://ipfs.io/ipfs/QmZJ5ZbJTfhQXM57PSWYy1VsHRDfL5AckjXy6W7RmP89AX (assuming we will have the latter come from IA later)

For example you can try a stream from IA with our player like this:

http://localhost:4000/stream/?ipfs=QmZJ5ZbJTfhQXM57PSWYy1VsHRDfL5AckjXy6W7RmP89AX&http=https://archive.org/download/decentralizedwebsummitmedia-2018-loglounge/DWeb%20Log%20Lounge%20080118%2001_720p.mp4

which works locally, but I imagine we'd have CORS problems once deployed since the IA mp4 does not have a wildcard Access-Control-Allow-Origin: *

js/vod-stream-embed.js Outdated Show resolved Hide resolved
titleDisplay: "Stream"
---

<style type="text/css">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌍

stream.md Outdated
---
layout: page
order: 0
title: "Stream"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call this/one not stream? It seems like we are moving toward "player"?


var stream_type = 'video/mp4'; // Type of video stream
var stream_url_ipfs = 'https://ipfs.io/ipfs/' // File path to stream with IPFS content via HTTP server
var stream_urls_http = []; // Optional list of URLs to stream over HTTP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand the flow for how the http stream will be queued, do you imagine there being a list of mirrors + potentially feeding in one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For recorded ones it only supports a single one via http URL param


live.on('error', function(event) {
console.debug(this.error());
document.getElementById('loadingTitle').innerHTML = 'Unable to load live stream';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These messages don't seem intuitive if we have a non-stream source

"Unable to load video" might be a good sub if could differentiate on source?

@dcwalk
Copy link
Member

dcwalk commented Sep 30, 2018

Thanks @benhylau! I've reviewed with the modicum of insight I have.
Interesting to see this come together! It would be good to merge in to the recorded-talks branch today for a total review tonight/early tomorrow.

@garrying you able to take a look?

@@ -2,84 +2,7 @@

var ipfs_gateway_self = 'https://ipfs-gateway.live.mesh.world'; // IPFS gateway of this node
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to set gateways in the config? maybe premature

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2019 :)

// Video-on-demand Stream Video

var ipfs_gateway_self = 'https://ipfs.io'; // IPFS gateway of this node
var ipfs_gateway_origin = 'https://ipfs.io'; // IPFS gateway of origin stream
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not following what this is for and how it corresponds to line 11. We're concating to one gateway?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows for swapping out the gateway. This is only relevant for livestream and is defined here for consistency.

@@ -0,0 +1,65 @@
---
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking this page will come back to haunt us 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@garrying
Copy link
Member

Merging this in. I think the major changes were the renaming from stream to video and condition for Unable to load video in video-player-embed.js

@garrying garrying merged commit 14df0eb into recorded-talks Sep 30, 2018
@garrying garrying deleted the vod-player branch September 30, 2018 21:22
dcwalk added a commit that referenced this pull request Oct 2, 2018
* remove unused start/end times fields
* initial structure for recorded talks
* update talk announcement
* add youtube links to session data
* remove front part of youtube link
* update to display of recorded talks
* fix presenter link
* orga condition
* update thanks order
* add ipfs 720 1080 links and update names
* update recorded talks page
* add alt take to thumbnail images
* Add video-on-demand player for recorded talks (#79)
* Add video-on-demand player for recorded talks
* Add standalone video-on-demand player with ipfs+http dynamic stream support
* Add the official video-on-demand player page
* Clean up video-on-demand player
* syntax stuff
* page rename and error condition
* updates
* minor updates revert to external links
* add ipfs icon
* fix ipfx icon
* play overlay
* flip
* border video links
* svg clean up
* update video size indication
* Change player gateway to ipfs.infura.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants