-
-
Notifications
You must be signed in to change notification settings - Fork 24.1k
Open
Labels
Description
Tested versions
- Reproducible in: 4.5.1.stable
System information
Godot v4.5.1.stable - Ubuntu 24.04.3 LTS 24.04 on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - integrated Intel(R) UHD Graphics (ICL GT1) - Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz (8 threads) - 7.55 GiB memory
Issue description
When setting a AudioStreamPlayer's stream_paused variable to true, it does not update the variable playing in the web export version, causing conflict between the two versions. (If a condition requires the AudioStreamPlayer's playing to be false, the condition wouldnt work in web export.)
Running the scene in godot:
Running the scene in web export (tested on firefox):
Steps to reproduce
- Create a Control scene
- Add two label nodes, one for stream paused and other for playing
- Add a AudioStreamPlayer node and attach a music to it
- Add a Timer node
- Add the below code script to the control connect
extends Control
@onready var label_stream_paused: Label = $Label
@onready var label_playing: Label = $Label2
var stream_paused_base_text: String
var playing_base_text: String
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
stream_paused_base_text = label_stream_paused.get_text()
playing_base_text = label_playing.get_text()
label_stream_paused.set_text(stream_paused_base_text + "false")
label_playing.set_text(playing_base_text + "true")
func pause_music(music: AudioStreamPlayer):
music.stream_paused = !music.stream_paused
label_stream_paused.set_text(stream_paused_base_text + str(music.stream_paused))
label_playing.set_text(playing_base_text + str(music.playing))
func _on_timer_timeout() -> void:
pause_music($AudioStreamPlayer)
- Connect Timer timeout signal to Control
- Add Web as a available project export
- Run project in Godot (running scene), then run the project in browser and check the playing state difference between the two
Minimal reproduction project (MRP)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
For team assessment