-
Notifications
You must be signed in to change notification settings - Fork 31
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
Migrated from video.js to livepeer.js's player #1260
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
packages/www/pages/_app.tsx
Outdated
@@ -54,6 +56,10 @@ Object.keys(themes).map( | |||
(key, _index) => (themeMap[themes[key].className] = themes[key].className) | |||
); | |||
|
|||
const livepeerClient = createReactClient({ | |||
provider: studioProvider({ apiKey: "b05094e0-05b6-4260-b462-bae581fdcf13" }), // TODO: replace with env var |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need any custom API key here? The playbackInfo
API is public, and even if it wasn't, we should not need any API key to use the player receiving only an HLS URL.
We can very likely just leave the default API key here in case the player just needs some LivepeerProvider
to be present (ideally it should not). Worst case, if we ever do need to call APIs with livepeer.js
, we should not use an API key but actually the same user JWT that is used on the dashboard (check ApiProvider
). This would give access to the account the user is logged in, not a random fixed account that we insert an API key here (worse, we'd likely need to put an admin API key here and we definitely don't want to leak that anywhere, ever).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I see what you're saying. Let me check if I can successfully initialise the provider without the api key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm that we can initialise it without any api key and there are not warnings or errors. So I will follow that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we shouldn't need an API key here to just use the player. If we are planning on using any other hooks from livepeer.js, we'd need to allow the client to provide a JWT. This might be a good feature though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this would be a nice feature. I think it'd actually be worthwhile refactoring the dashboard frontend to use livepeer.js at some point.
0821bc4
to
af2834b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@clacladev small request: can we make sure the border bottom radius doesn't get cut off? Giving the video element a display: flex
should fix.
Codecov Report
@@ Coverage Diff @@
## master #1260 +/- ##
===================================================
- Coverage 51.47834% 51.38666% -0.09169%
===================================================
Files 66 66
Lines 4363 4363
Branches 791 791
===================================================
- Hits 2246 2242 -4
- Misses 1835 1838 +3
- Partials 282 283 +1
Continue to review full report at Codecov.
|
I'm going to push this to prod. Can address my small comment in a separate PR. |
@adamsoffer yes I see the small corner issue. I can address it in a small PR asap |
What does this pull request do? Explain your changes. (required)
Migrated from video.js to livepeer.js's React VideoPlayer
Specific updates (required)
-
How did you test each of these updates (required)
Created a preview build with the changes and opened the an asset (this one requires admin privileges):
https://livepeer-studio-mdg4ql6nn-livepeer.vercel.app/dashboard/assets/6aa5e390-8724-4c5b-855b-4f2992cd1b40
Does this pull request close any open issues?
Fixes #1227
Screenshots (optional):
Checklist: