Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

Commit

Permalink
re-added audio-ios-initialiser with deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
rparree committed Sep 13, 2020
1 parent 4e11cd9 commit fcf0258
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
21 changes: 20 additions & 1 deletion webyarns-util/lib/audio-ios-initialiser.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
"use strict";

console.log("Deprecated script: audio-ios-initialiser. Is no longer needed");
(function () {
function preloadAllAudio(evt) {
evt.preventDefault();
document.querySelectorAll("audio").forEach(function (elem) {
elem.play().then(function () {
return elem.pause();
});
});
Reveal.next();
}

document.addEventListener("DOMContentLoaded", function () {
console.log("Deprecated script: audio-ios-initialiser. Is no longer needed");
var audioInitLink = document.getElementById("ipad-audio-init");
if (!audioInitLink) return;
['touchstart', 'click'].forEach(function (name) {
return audioInitLink.addEventListener(name, preloadAllAudio);
});
});
})();
2 changes: 1 addition & 1 deletion webyarns-util/lib/audio-ios-initialiser.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion webyarns-util/src/audio-ios-initialiser.ts
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
console.log("Deprecated script: audio-ios-initialiser. Is no longer needed")
(function () {
function preloadAllAudio(evt: Event) {
evt.preventDefault()
document.querySelectorAll("audio").forEach((elem) => {
elem.play().then(()=>elem.pause())
})
Reveal.next();
}

document.addEventListener("DOMContentLoaded", () => {
console.log("Deprecated script: audio-ios-initialiser. Is no longer needed")

const audioInitLink = document.getElementById("ipad-audio-init");
if (!audioInitLink)
return
['touchstart', 'click'].forEach(name => audioInitLink.addEventListener(name,preloadAllAudio) )
})
})()

0 comments on commit fcf0258

Please sign in to comment.