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

PLAT-80843: Add Shaka Video Player sample #81

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

teckliew
Copy link
Member

@teckliew teckliew commented Jul 2, 2019

Add a video player sample that uses Shaka: https://shaka-player-demo.appspot.com/docs/api/index.html

Copy link
Contributor

@ryanjduffy ryanjduffy left a 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} />
Copy link
Contributor

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) {
Copy link
Contributor

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;
Copy link
Contributor

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');
Copy link
Contributor

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 = {
Copy link
Contributor

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?

Teck Liew and others added 4 commits July 2, 2019 16:32
Signed-off-by: Ryan Duffy <ryan.duffy@lge.com>
Signed-off-by: Ryan Duffy <ryan.duffy@lge.com>
Copy link
Contributor

@ryanjduffy ryanjduffy left a 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!

Copy link
Contributor

@webOS101 webOS101 left a 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.",
Copy link
Contributor

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

Copy link
Member Author

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": "",
Copy link
Contributor

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?

Copy link
Member Author

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",
Copy link
Contributor

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",
Copy link
Contributor

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(
Copy link
Contributor

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?

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


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.

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.

4 participants