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

Implement Player generation & oEmbed endpoints #140

Open
sundowndev opened this issue Mar 3, 2021 · 0 comments
Open

Implement Player generation & oEmbed endpoints #140

sundowndev opened this issue Mar 3, 2021 · 0 comments
Assignees
Labels
kind/enhancement New feature or request
Milestone

Comments

@sundowndev
Copy link
Member

sundowndev commented Mar 3, 2021

This feature should allow a user to easily implement a HTML5 production-ready video player into his own web page.

Example use case

  1. User makes an HTTP request to POST /players player options included, to create a new player
  2. User retrieve the newly created player if needed by making a request to GET /players/:player_uuid
  3. User can now make a request to GET /players/:player_uuid/oembed?url=media_url&format=json to embed the player in its own page

Implementation

Routes

  • POST /players - Create a player
  • PUT /players - Edit a player
  • DELETE /players - Delete a player
  • GET /players - Retrieve all players
  • GET /players/:uuid - Get one player
  • GET /players/:uuid/oembed - Get oEmbed object
  • GET /players/:uuid/embed/:media_uuid - Get HTML5 player to embed

Player generation

  • Solution 1 : store static assets in the VCS, then embed them in the binary then serve the content as a single HTML response. Assets include : videojs-css, videojs-js. VideoJS options are altered according to the player's options.

Example oEmbed response

  • GET /players/fa3b3ec9-2388-4196-96cc-d7ca1a86f3da/oembed?media=fa3b3ec9-2388-4196-96cc-d7ca1a86f3da&format=json
{
  "title": "cyberpunk 2077 gameplay",
  "author_name": "",
  "author_url": "",
  "type": "video",
  "height": 640,
  "width": 360,
  "version": "1.0",
  "provider_name": "Gilfoyle",
  "provider_url": "https://demo.gilfoyle.dreamvo.com/",
  "thumbnail_height": 360,
  "thumbnail_width": 480,
  "thumbnail_url": "https://cdn.demo.gilfoyle.dreamvo.com/fa3b3ec9-2388-4196-96cc-d7ca1a86f3da/previews/fa3b3ec9-2388-4196-96cc-d7ca1a86f3da.jpg",
  "html": "<iframe width=\"200\" height=\"113\" src=\"https://demo.gilfoyle.dreamvo.com/players/fa3b3ec9-2388-4196-96cc-d7ca1a86f3da/embed/fa3b3ec9-2388-4196-96cc-d7ca1a86f3da?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>"
}

We'll only support JSON format for now. XML will come later.

Player options

  • loop: bool
  • controls: bool
  • autoplay: bool
  • muted: bool
  • preload: string
  • playbackRates: []float32

References

@sundowndev sundowndev added kind/enhancement New feature or request go labels Mar 3, 2021
@sundowndev sundowndev self-assigned this Mar 3, 2021
@sundowndev sundowndev changed the title Implement Player generation Implement Player generation & oEmbed endpoints Mar 3, 2021
@sundowndev sundowndev added this to the v0.3.0 milestone Mar 4, 2021
@sundowndev sundowndev removed the go label Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant