За последние 24 часа нас посетили 15762 программиста и 1664 робота. Сейчас ищут 843 программиста ...

Javascript выключает изменение громкости.

Тема в разделе "JavaScript и AJAX", создана пользователем zasadadada, 31 май 2013.

  1. zasadadada

    zasadadada Новичок

    С нами с:
    11 май 2013
    Сообщения:
    27
    Симпатии:
    0
    Есть
    Код (Text):
    1.  
    2. function setupWebAudio() {
    3.     // Get our <audio> element
    4.     var audio = document.getElementById('music');
    5.     // Create a new audio context (that allows us to do all the Web Audio stuff)
    6.     var audioContext = new webkitAudioContext();
    7.     // Create a new analyser
    8.     analyser = audioContext.createAnalyser();
    9.     // Create a new audio source from the <audio> element
    10.     var source = audioContext.createMediaElementSource(audio);
    11.     // Connect up the output from the audio source to the input of the analyser
    12.     source.connect(analyser);
    13.     // Connect up the audio output of the analyser to the audioContext destination i.e. the speakers (The analyser takes the output of the <audio> element and swallows it. If we want to hear the sound of the <audio> element then we need to re-route the analyser's output to the speakers)
    14.     analyser.connect(audioContext.destination);
    15.  
    16.     // Get the <audio> element started 
    17.     audio.play();
    18. }
    на index.php
    Код (Text):
    1.  
    2.                             <audio id="music" controls>
    3.                               <source  src="ссылка на звук">
    4.                             </audio>
    не работает крутилка громокости, не могу понять как активировать. Если выключить javascript то рабоатет. Подскажите как быть.
     
  2. Your

    Your Старожил

    С нами с:
    2 июл 2011
    Сообщения:
    4.074
    Симпатии:
    7
    А объект setupWebAudio() вы вызываете?