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

api: New API to get playback URL from an identifier #1075

Merged
merged 9 commits into from
May 26, 2022

Conversation

victorges
Copy link
Member

@victorges victorges commented May 19, 2022

What does this pull request do? Explain your changes. (required)

This creates an API to facilitate and create a consistent interface for creating a playback URL
given an identifier. It could be either a stream or asset playback ID, or also a recorded session
ID and it will return a response in the same format containing the corresponding HLS playback URL.

The context for this is the creation of the Lens publication video NFTs with an embeddable HLS player.
Ideally the NFT would have no internal identifiers from livepeer.com, maybe referencing assets by their
CIDs instead. While we don't do that, we can at least simplify that internal identifier and only provide a
playback ID (additionally from the CID of the original file). The playback ID will be used to playback
a pre-processed version of the video in an optimized format.

Having this API also makes these NFTs future-proof, since we will be able to change their format without
it breaking every previously minted NFT that had the broken references. The reference will be only a simple
playback ID and we can change the response of that API freely.

This also has a soft dependency on #1051 but they can be deployed independently. It's also based on top of
#1014 but I believe it can also be rebased, no strict dependencies in the code.

Specific updates (required)

  • Create new API for resolving the playback URL
  • Add tests 🙌

-

  • How did you test each of these updates (required)
    yarn test

Does this pull request close any open issues?

Implements #1058

Checklist:

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@vercel
Copy link

vercel bot commented May 19, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
livepeer-com ✅ Ready (Inspect) Visit Preview May 26, 2022 at 11:49PM (UTC)

@victorges victorges changed the base branch from master to vg/feat/asset-ipfs-builtin May 19, 2022 22:45
@victorges victorges changed the title Vg/feat/playback url api api: New API to get playback URL from an identifier May 23, 2022
@victorges victorges marked this pull request as ready for review May 24, 2022 00:02
@victorges victorges requested a review from a team as a code owner May 24, 2022 00:02
@codecov
Copy link

codecov bot commented May 25, 2022

Codecov Report

Merging #1075 (bf54844) into master (ee0c219) will increase coverage by 3.92880%.
The diff coverage is 69.33333%.

❗ Current head bf54844 differs from pull request most recent head c417d6b. Consider uploading reports for the commit c417d6b to get more accurate results

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #1075         +/-   ##
===================================================
+ Coverage   45.68115%   49.60995%   +3.92879%     
===================================================
  Files             64          66          +2     
  Lines           4052        4102         +50     
  Branches         708         690         -18     
===================================================
+ Hits            1851        2035        +184     
+ Misses          1987        1839        -148     
- Partials         214         228         +14     
Impacted Files Coverage Δ
packages/api/src/app-router.ts 54.05405% <ø> (ø)
packages/api/src/webhooks/cannon.ts 48.25581% <0.00000%> (-0.28221%) ⬇️
packages/api/src/controllers/session.ts 15.83333% <20.00000%> (+9.72645%) ⬆️
packages/api/src/task/scheduler.ts 41.53846% <28.57143%> (+35.98290%) ⬆️
packages/api/src/controllers/asset.ts 37.82609% <67.85714%> (+30.50901%) ⬆️
packages/api/src/controllers/playback.ts 90.32258% <90.32258%> (ø)
packages/api/src/controllers/stream.ts 48.89937% <100.00000%> (+0.62892%) ⬆️
packages/api/src/index.ts 49.09091% <100.00000%> (ø)
packages/api/src/store/asset-table.ts 100.00000% <100.00000%> (ø)
packages/api/src/store/db.ts 82.02247% <100.00000%> (ø)
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c691933...c417d6b. Read the comment docs.

Copy link
Member

@hjpotter92 hjpotter92 left a comment

Choose a reason for hiding this comment

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

lgtm

Base automatically changed from vg/feat/asset-ipfs-builtin to master May 26, 2022 23:28
@victorges victorges merged commit f3cdb57 into master May 26, 2022
@victorges victorges deleted the vg/feat/playback-url-api branch May 26, 2022 23:30
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

2 participants