Skip to content

Instantly share code, notes, and snippets.

@ya7ya
Last active September 5, 2018 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ya7ya/b72a926b00aeada35e1121c0285bd784 to your computer and use it in GitHub Desktop.
Save ya7ya/b72a926b00aeada35e1121c0285bd784 to your computer and use it in GitHub Desktop.

Objective


Get paratii to play livepeer streams in a seamless way.

What's the current structure of paratii player?

Paratii mainly compromises of 3 core parts:

  • paratii-js : This has all the logic required to interact with paratii-contracts on the blockchain, and IPFS.

  • paratii-portal: the main React app where the player lives

  • paratii-mediaplayer : a clappr based player that has various custom loaders to allow Clappr to pull content from IPFS and/or XHR.

What needs to change?

Mainly, the paratii-mediaplayer loader needs to be able to integrate with livepeer and resolve livepeer channels. the mediaplayer has a loader that is based on hlsjs-ipfs-loader it's currently able to:

  • get playlists via IPFS or normal XHR loading (through the IPFS gateway)
  • get ts segments and feed them into hls.js.

so this loader need to be extended to be able to get both playlists & segments from the livepeer network smoothly, it'll use livepeerJs various libraries to achieve that and it'll follow the same logic used in @livepeer/player

differeniating a livefeed from a normal video on paratii would probably require a simple URL parser so paratii would know whether to use livepeer or IPFS to get the required video/stream

example normal video: https://lab.paratii.video/play/cugXqidPKCR9

livepeer stream: https://lab.paratii.video/lp/<eth_address>

UI changes to paratii

there needs to be a live mode (red live LED), and no start/end timestamps without breaking the interface.

I'm looking into how to make the changes in an efficient manner, I'll keep you updated regarding this.

@ericxtang
Copy link

ericxtang commented Sep 5, 2018

Good start here @ya7ya.

Can you elaborate on your vision about the live streaming workflow? If someone creates a live stream in Livepeer as a broadcaster, how does she get the Paratti player to start playing that stream? (For example, does the Paratti player simply take a url param? Should this url be uploaded somewhere so the Paratti player can get it?)

Note, currently a new job is created when a live stream is created in Livepeer. But it has proven to be a bit of a bottleneck and we are thinking about taking it away (sorry I forgot to mention this on the call - had to think this through a little more). So I think for now, we can expect the Livepeer broadcaster (operator of the Livepeer node) is in charge of publishing the viewing URL.

@ya7ya
Copy link
Author

ya7ya commented Sep 5, 2018

Can you elaborate on your vision about the live streaming workflow? If someone creates a live stream in Livepeer as a broadcaster, how does she get the Paratti player to start playing that stream? (For example, does the Paratti player simply take a url param? Should this url be uploaded somewhere so the Paratti player can get it?)

hey @ericxtang

Yeah, sure, My current understanding is the broadcaster is in charge of sharing his eth address, and I can use the existing tools (@livepeer/sdk and graphql ) to pull the latest job and get that manifest. so it's going to mimic @livepeer/player

But this is my initial assumption (which i'm testing right now) so i'm open to ideas here 👍

@ericxtang
Copy link

The job onchain only provides the stream ID, but not the entire URL. So the URL has to be provided somehow. In the current player it's hard-coded. But that's bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment