move play button to svg-defs

This commit is contained in:
Jakob Ketterl
2021-05-16 17:47:02 +02:00
parent a04f198ade
commit 979f11f40a
6 changed files with 77 additions and 12 deletions

View File

@@ -1213,19 +1213,12 @@ var audioEngine;
function openwebrx_init() {
audioEngine = new AudioEngine(audio_buffer_maximal_length_sec, audioReporter);
$('body').on('click', '#openwebrx-autoplay-overlay', function(){
var $overlay = $('#openwebrx-autoplay-overlay');
$overlay.on('click', function(){
audioEngine.resume();
});
audioEngine.onStart(onAudioStart);
if (!audioEngine.isAllowed()) {
var $overlay = $(
'<div id="openwebrx-autoplay-overlay" class="openwebrx-overlay" style="display:none;">' +
'<div class="overlay-content">' +
'<img id="openwebrx-play-button" src="static/gfx/openwebrx-play-button.svg" />' +
'<div>Start OpenWebRX</div>' +
'</div>' +
'</div>'
);
$('body').append($overlay);
$overlay.show();
}