0 votes

Hi,

I have a VideoPlayer node in a scene with an associated .ogv file stream setup in the inspector. Pressing the 'play the project' arrow button runs the scene and video but the player.get_stream_name() method returns null.

Checking the return type using typeof(player.get_stream_name()) returns 4 - don't know what this is:

func _ready():
    var player = get_node("VideoPlayer")
    print("playing? ", player.is_playing()) # outputs "playing: True"
    print("stream: ", player.get_stream_name()) #outputs "stream: " 

... so print("stream: ", player.get_stream_name()) statement returns: "stream: " and no filename.

Can you help please?

Thanks

asked Mar 13 in Gossip by marcorexo (80 points)
edited Mar 13 by marcorexo

1 Answer

+1 vote

No idea why this is so (you could open a ticket for this, might be an error).

But you could use the streams resource_name instead.
So:
player.stream.resource_name
or:
player.stream.resource_path

answered Mar 14 by wombatstampede (2,013 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.