-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature/#429 add missing video props #505
Conversation
prepareMediaPlayer() | ||
} else { | ||
addTimedTextPath(subtitlesPath.toString(), onSubtitleChangeListener) | ||
prepareMediaPlayer() |
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.
preparareMediaPlayer()
can be moved to line 85
UiTextNode.PROP_TEXT_SIZE, | ||
0.1, | ||
PROP_LOCAL_POSITION, | ||
JavaOnlyArray.of(localPosition.x, localPosition.y, localPosition.z + 0.01f), | ||
PROP_LOCAL_SCALE, | ||
JavaOnlyArray.of(localScale.x, localScale.y, localScale.z), | ||
PROP_ALIGNMENT, | ||
"top-center", | ||
PROP_BOUNDS_SIZE, | ||
JavaOnlyMap.of(PROP_BOUNDS_SIZE, JavaOnlyArray.of(getBounding().size().x, getBounding().size().y))) |
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.
Can we somehow refactor this? Like:
UiTextNode.PROP_TEXT_SIZE, 0.1,
PROP_LOCAL_POSITION, JavaOnlyArray.of(localPosition.x, localPosition.y, localPosition.z + 0.01f)
...
private fun createSubtitles() { | ||
if (subtitles == null) { | ||
subtitles = UiSubtitlesNode( | ||
props = getSubtitleProps(), context = context, viewRenderableLoader = viewRenderableLoader, nodeClipper = nodeClipper, fontProvider = fontProvider) |
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.
This line is probably too long, lets put each property in a new line. Also the closing bracket should be in the new line ;-)
@@ -0,0 +1,54 @@ | |||
package com.magicleap.magicscript.scene.nodes.views |
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.
licence
@@ -0,0 +1,63 @@ | |||
package com.magicleap.magicscript.scene.nodes.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.
licence
@@ -0,0 +1,33 @@ | |||
package com.magicleap.magicscript.scene.nodes.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.
licence
@@ -91,6 +106,38 @@ class VideoNode( | |||
setAction(props) | |||
setLooping(props) | |||
setVolume(props) | |||
setSeekTo(props) | |||
if(props.containsAny(PROP_SIZE, PROP_LOCAL_SCALE, PROP_LOCAL_POSITION)) updateSubtitlesProps() |
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.
Use brackets after the if
and put updateSubtitlesProps()
into new line (we followed this practice so far)
if(subtitles != null) { | ||
contentNode.removeChild(subtitles) | ||
subtitles = null | ||
} |
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.
Can we put this after super.onDestroy
?
@@ -0,0 +1,27 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<!-- | |||
~ Copyright (c) 2019 Magic Leap, Inc. All Rights Reserved |
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 be used new licence: 2019-2020
according to this PR
I tested the Video scene from the Catalog and the subtitles are not positioned correctly (the position depends on movie). Hint: in the |
Another issues discovered when testing:
|
@@ -1,3 +1,19 @@ | |||
/* | |||
* Copyright (c) 2019-2020 Magic Leap, Inc. All Rights Reserved |
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 this is a new file then it shouldn't have 2019 since it was created in 2020.
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.
Done
379a481
to
a34a489
Compare
Add timedTextPath and seekTo properties. Click link below to see how it looks like on the video:
Resolve #429
Video