Skip to content

Commit

Permalink
Firefox permission add-on
Browse files Browse the repository at this point in the history
  • Loading branch information
infojunkie committed Apr 5, 2022
1 parent 5f24e65 commit 9616545
Show file tree
Hide file tree
Showing 11 changed files with 2,783 additions and 4 deletions.
11 changes: 10 additions & 1 deletion demo/web/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,24 @@
width: 35px;
}
#file-error {
border: 1px;
background-color: brown;
color: lightgray;
}
#firefox-midi {
background-color: orange;
}
</style>
</head>
<body>
<a href="https://github.com/infojunkie/ireal-musicxml/tree/main/demo/web"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>

<div id="firefox-midi" class="hide">
Greetings Firefox user!
<p>In order to use the Web MIDI capabilities of this demo, you will need to install an add-on that enables it to request the permissions needed to access your MIDI devices.</p>
<p>Once you've downloaded the add-on, please refresh the page to activate Web MIDI in the demo.</p>
<p>Thanks for your cooperation. You can <a href="site_permissions_for_blogkarimratibme-1.0-an+fx.xpi">download the add-on here.</a></p>
</div>

<div>
<label for="playlist">Upload an iReal Pro playlist or a MusicXML file</label>&nbsp;
<input type="file" id="playlist" name="playlist"/>
Expand Down
11 changes: 9 additions & 2 deletions demo/web/dist/ireal2musicxml-demo.js

Large diffs are not rendered by default.

Binary file modified demo/web/dist/ireal2musicxml-demo.js.gz
Binary file not shown.
Binary file not shown.
9 changes: 8 additions & 1 deletion demo/web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,15 @@ window.addEventListener('load', function () {
document.getElementById('pause').addEventListener('click', handleMidiPause, false);

if (navigator.requestMIDIAccess) navigator.requestMIDIAccess().then(midiAccess => {
document.getElementById('firefox-midi').classList.add('hide');
populateMidiOutputs(midiAccess);
midiAccess.onstatechange = () => populateMidiOutputs(midiAccess);
midi.access = midiAccess;
}, error => console.error(error));
}, error => {
const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
if (isFirefox) {
document.getElementById('firefox-midi').classList.remove('hide');
}
console.error(error);
});
})
1 change: 1 addition & 0 deletions test/data/blues.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/data/brazilian.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/data/country.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/data/latin.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/data/pop.txt

Large diffs are not rendered by default.

Loading

0 comments on commit 9616545

Please sign in to comment.