fix(wasm): request permission for media autoplay if needed

This commit is contained in:
Pascal Engélibert 2022-08-28 19:33:41 +02:00
commit 53bf4b1aef
Signed by: tuxmain
GPG key ID: 3504BC6D362F7DCA
14 changed files with 44 additions and 467 deletions

View file

@ -20,22 +20,6 @@ impl Plugin for MenuPlugin {
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
let font = asset_server.get_handle("UacariLegacy-Thin.ttf");
#[cfg(target_arch = "wasm32")]
commands
.spawn_bundle(Text2dBundle {
text: Text::from_section(
"Note:\nAudio is NOT available in the WASM build.",
TextStyle {
font: font.clone(),
font_size: 24.0,
color: Color::rgba(1., 0.4, 0.4, 1.),
},
)
.with_alignment(TextAlignment::CENTER),
transform: Transform::from_xyz(0., -128.0, 0.),
..Default::default()
})
.insert(Menu);
commands
.spawn_bundle(Text2dBundle {
text: Text::from_section(