Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

66
Views
requestMIDIAccess not working on Android locally, getting DOMException

I'm trying to access MIDI devices using the local Test.html page loaded on my smartphone(galaxy a40):

<!DOCTYPE html>
<html lang="ru">
<head><meta charset="utf-8" /><title>Test</title></head>
<body>
<script> 
navigator.requestMIDIAccess( { sysex: true } ).catch(console.error);
</script>
</body>
</html>

I get this console output: DOMException: An attempt was made to break through the security policy of the user agent. At the same time, https://virtualpiano.eu/ has no access problems. Chrome browsers 97,98,100 Please tell me how to fix

7 months ago · Juan Pablo Isaza
1 answers
Answer question

0

Chrome will only grant access to Web MIDI in secure contexts. See the MIDIAccess docs on MDN:

This feature is available only in secure contexts (HTTPS)

The reason the site you linked to works is because it uses HTTPS. Note: localhost is also treated as a secure context for development purposes, if you want to develop locally try running a web server.

7 months ago · Juan Pablo Isaza Report
Answer question
Find remote jobs