-
Notifications
You must be signed in to change notification settings - Fork 12
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
PLAT-80843: Add Shaka Video Player sample #81
base: develop
Are you sure you want to change the base?
Conversation
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.
Thanks, @teckliew! I think the HOC approach is good and I like how this is shaping up. Couple considerations below. Let me know what you think!
render: (props) => ( | ||
<Panel {...props}> | ||
<Header title="VideoPlayer" titleBelow="powered by Shaka Player" /> | ||
<ShakaVideoPlayer autoPlay manifestUri={sintelManifestUri} /> |
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.
autoPlay
doesn't seem to be working. Are you seeing the same?
onError(event.detail); | ||
} | ||
|
||
function onError(error) { |
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.
Let's make this a bit more React-y by moving these handlers into the component and invoking callbacks via props as usual. Could then move the console.error
into the app instead of here.
|
||
render () { | ||
const props = Object.assign({}, this.props); | ||
delete props.manifestUri; |
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.
spacing
|
||
function initPlayer(config, manifestUri) { | ||
// Create a Player instance. | ||
const video = document.querySelector('video'); |
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 discovered the issue with getVideoNode()
. We abstracted access to the DOM node behind ui/Media
so you have to do something like videoPlayer.getVideoNode().media
to get all the way to the node.
I'm not sure we should expose that (it's not terrible but it isn't good either) but I think a "within React" impl (e.g. using findDOMNode()
or the above code) would be better to show in a sample than querySelector
. Wdyt?
console.error('Error code', error.code, 'object', error); | ||
} | ||
|
||
const defaultConfig = { |
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.
Should these be runtime props vs design time configs?
Signed-off-by: Ryan Duffy <ryan.duffy@lge.com>
Signed-off-by: Ryan Duffy <ryan.duffy@lge.com>
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 made a couple small changes (forward shaka errors out, rename HOC for consistency and export it) to put it more inline with our conventions for pattern samples. Seems like a great starting point for using Shaka Player. Thanks, @teckliew!
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.
If we just needed a demo and aren't going to publish this, we don't need to really address these comments. Leaving them here in case we want to do more with it.
{ | ||
"name": "shaka-app", | ||
"version": "1.0.0", | ||
"description": "A general template for an Enact Moonstone application.", |
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.
Let's update the description for completeness
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.
:yougotitdude:
"name": "shaka-app", | ||
"version": "1.0.0", | ||
"description": "A general template for an Enact Moonstone application.", | ||
"author": "", |
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.
Want to add your name here, Teck?
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.
:okay:
"test": "enact test", | ||
"test-watch": "enact test --watch" | ||
}, | ||
"license": "UNLICENSED", |
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.
Let's make this apache like our others.
"dist/*" | ||
], | ||
"dependencies": { | ||
"@enact/core": "^2.0.0", |
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.
Should we update to 3.x? Add ilib
? Update React?
this.onError(event.detail); | ||
} | ||
|
||
onError = handle( |
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.
Is this the right way to bind the handler?
Teck Liew seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Add a video player sample that uses Shaka: https://shaka-player-demo.appspot.com/docs/api/index.html