This repository has been archived by the owner on Sep 4, 2023. It is now read-only.
forked from hakimel/reveal.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
re-added audio-ios-initialiser with deprecation warning
- Loading branch information
Showing
3 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
}); | ||
})(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) ) | ||
}) | ||
})() | ||
|