Programatic media recorder call

Hello I am currently trying to create a project that has multiple scenes and launches them with an overlay that introduces them to the game and has a start button that emits the event // Start after 5 seconds

setTimeout(() => {

  countdown.remove()

  window.dispatchEvent(new CustomEvent('xrextrasmediarecorder:startrecording'))

  console.log('\[intro-overlay\] recording started after delay')

}, 5000) to programatically click the recording button for the user however no matter how long i wait or if i retry after the xr and media recorder pipelines are there i am met with the media recorder not ready error. Do you all have any working examples of a media recorder being called in the fixed mode from an event dispatch?

You’re not starting the recording correctly. Instead of dispatching an event you should be calling a function:

xr | 8th Wall

Then listen for the event that the function broadcasts:

Thanks George sorry for not providing context I am not using the studio API I am in the web I have tried the solutions but world is not available for me. is there a solution that works with the web api

Oh, no problem! We’ve created a package to make this really easy called xrextras. Check it out here:

Specificially the MediaRecorder module: