Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Background music in the project is rewound when switching between links in the browser

Discussion in 'WebGL' started by Kino_Arty, Oct 22, 2022.

  1. Kino_Arty

    Kino_Arty

    Joined:
    Aug 22, 2022
    Posts:
    3
    Hi in general there is a problem. There is a project in it there is background music that is played as soon as the game is turned on, there is a condition in the build that the game and sound will not be played if the window with the project is not active.
    The problem is that when switching between browser tabs (for example, there are two tabs 1. a tab with a game 2. a tab with unity forum) when switching from the first tab to the second, the music stops, but when switching back from 2 to 1, the music rewinds by 30-40%. How can this be solved? I made a test project in which I added only Audio force and a picture to the background. And this one is there too!
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,196
    Which platform?
    What is this "audio inactive" build setting? Or is it a script you wrote? If so, please post that.
    Do you use Pause/Unpause or Play/Stop?
     
  3. Kino_Arty

    Kino_Arty

    Joined:
    Aug 22, 2022
    Posts:
    3
    I have already solved this problem) There was a bug in the unity version itself)