[Webkit-unassigned] [Bug 231656] createMediaElementSource() not working with HLS/m3u8 stream

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 15 18:12:15 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=231656

--- Comment #1 from Guy <guy.sapir at symbl.ai> ---
This following issue presented here a major blocker for us and for our customers and we need your help and will appreciate if this issue can be addressed ASAP.


We're using new webkitAudioContext() in Safari 15.0 on MacBook or iOS Safari on iPhone and iPad to create AudioContext instance, and we're creating ScriptProcessorNode and attaching it to the HLS/m3u8 source create using audioContext. createMediaElementSource(). The onaudioprocess callback gets called with the audio data, but no data is processed and instead we get 0’s. 

If you also connect Analyser node to the same audio source create using audioContext. createMediaElementSource(), analyser.getByteTimeDomainData(dataArray) populates no data in the data but onaudioprocess on the ScriptProcessorNode on the same source 

What has been tried:
* We confirmed that the stream being used is the only stream in the tab and createMediaElementSource() was only called once to get the stream. 
* We confirmed that if the stream source is MP4/MP3 it works with no issues and data is received in onaudioprocess, but when modifing the source to HLS/m3u8 it does not work
* We also tried using MediaRecorder with HLS/m3u8 as the stream source but didn’t get any events or data
* We also tried to create two AudioContext’s, so the first AudioContext will be the source passing the createMediaElementSource as the destination to the other Audio Context and then pass it to ScriptProcessorNode, but Safari does not allow more than one output.    


Currently none of the scenarios we tried works and this is a major blocker to us and for our customers. 


Code sample used to create the ScriptProcessorNode:

const AudioContext = window.AudioContext || window.webkitAudioContext;

audioContext = new AudioContext();

// Create a MediaElementAudioSourceNode
// Feed the HTML Video Element 'VideoElement' into it

const audioSource = audioContext.createMediaElementSource(VideoElement);

const processor = audioContext.createScriptProcessor(2048, 1, 1);
processor.connect(audioContext.destination);
processor.onaudioprocess = (e) => {
    // Does not get called when connected to external microphone
    // Gets called when using internal MacBook microphone
    console.log('print audio buffer', e);
  }


The exact same behavior is also observed on iOS Safari on iPhone and iPad.

Safari knows as the expert for HLS/m3u8 and we are asking for your help on this matter ASAP. 

Thanks,

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211016/b2d78e07/attachment-0001.htm>


More information about the webkit-unassigned mailing list