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

VideoStreamPlayer has Expand enabled by default, causing it to be sized at 0×0 by default (therefore being invisible) #36647

Closed
lszl84 opened this issue Feb 28, 2020 · 4 comments · Fixed by #62755

Comments

@lszl84
Copy link

lszl84 commented Feb 28, 2020

Godot version: master (947a663)

OS/device including version: mac OS 10.15.3

Issue description: Video does not play in Godot 4. Works in Godot 3.

Steps to reproduce: Open attached project in Godot 3.2. Run it and verify that the video is playing. Close the project and open it in Godot 4. No video is being played when running the project.

Minimal reproduction project:
godot3vid-3.zip

@hungrymonkey
Copy link
Contributor

ERROR: Condition "texture.is_null()" is true.
   at: update (scene/resources/texture.cpp:196)
ERROR: Condition "texture.is_null()" is true.
   at: update (scene/resources/texture.cpp:196)
ERROR: Condition "texture.is_null()" is true.
   at: update (scene/resources/texture.cpp:196)
ERROR: Condition "texture.is_null()" is true.
   at: update (scene/resources/texture.cpp:196)
ERROR: Condition "texture.is_null()" is true.
   at: update (scene/resources/texture.cpp:196)
ERROR: Condition "texture.is_null()" is true.
   at: update (scene/resources/texture.cpp:196)
ERROR: Condition "texture.is_null()" is true.
   at: update (scene/resources/texture.cpp:196)
ERROR: Condition "texture.is_null()" is true.
   at: update (scene/resources/texture.cpp:196)
ERROR: Condition "texture.is_null()" is true.
   at: update (scene/resources/texture.cpp:196)
ERROR: Condition "texture.is_null()" is true.
   at: update (scene/resources/texture.cpp:196)
ERROR: Condition "texture.is_null()" is true.
   at: update (scene/resources/texture.cpp:196)
ERROR: Condition "texture.is_null()" is true.
   at: update (scene/resources/texture.cpp:196)
ERROR: Condition "texture.is_null()" is true.
   at: update (scene/resources/texture.cpp:196)
ERROR: Condition "texture.is_null()" is true.
   at: update (scene/resources/texture.cpp:196)

bug_video 2.zip

I can hear sound but the video does not work.

Screen Shot 2020-05-09 at 5 21 09 PM

@KoBeWi KoBeWi added this to the 4.0 milestone Nov 15, 2020
@Jayman2000
Copy link
Contributor

@Calinou
Copy link
Member

Calinou commented Mar 5, 2022

@Jayman2000 Theora is still supported in master – it's just that WebM support was removed in master.

@Calinou
Copy link
Member

Calinou commented Jul 5, 2022

I can hear sound but the video does not work.

This is because the VideoStreamPlayer node has a rect size of 0×0, causing it to be invisible. Disable the Expand property on the VideoStreamPlayer node, or set the Layout to Full Rect (will cause aspect ratio distortion unless the video's aspect ratio matches).1

image

The same applies to @lszl84's minimal reproduction project.

I suggest fixing this by disabling the Expand property by default on VideoStreamPlayer in 4.0, but we can't do this in 3.x to avoid breaking compatibility with existing projects. It may also be worth adding similar scaling options as TextureRect:

image

Additionally, we can add a node configuration warning if a Control node's rect size is 0 pixels on either the X or Y axis (which will make it invisible). This is something we can also add to 3.x.

Footnotes

  1. To preserve the aspect ratio on wider window aspect ratios, set the Layout to Full Rect, then use the Anchors Only submenu to set the anchors to VCenter Wide.

@Calinou Calinou changed the title VideoPlayer not playing Theora OGV in Godot 4 VideoPlayer has Expand enabled by default, causing it to be sized at 0×0 by default (therefore being invisible) Jul 5, 2022
@Calinou Calinou changed the title VideoPlayer has Expand enabled by default, causing it to be sized at 0×0 by default (therefore being invisible) VideoStreamPlayer has Expand enabled by default, causing it to be sized at 0×0 by default (therefore being invisible) Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants