Feature/#429 add missing video props - #505
Conversation
| prepareMediaPlayer() | ||
| } else { | ||
| addTimedTextPath(subtitlesPath.toString(), onSubtitleChangeListener) | ||
| prepareMediaPlayer() |
There was a problem hiding this comment.
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.
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.
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 | |||
| @@ -0,0 +1,63 @@ | |||
| package com.magicleap.magicscript.scene.nodes.video | |||
| @@ -0,0 +1,33 @@ | |||
| package com.magicleap.magicscript.scene.nodes.video | |||
| 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.
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.
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.
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.
if this is a new file then it shouldn't have 2019 since it was created in 2020.
379a481 to
a34a489
Compare


Add timedTextPath and seekTo properties. Click link below to see how it looks like on the video:
Resolve #429
Video