Skip to content

Commit

Permalink
Put Safari back on single-audio-node mode
Browse files Browse the repository at this point in the history
  • Loading branch information
icidasset committed Jun 6, 2022
1 parent 4088ae1 commit 5225c48
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Javascript/audio-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const IS_SAFARI = !!navigator.platform.match(/iPhone|iPod|iPad/) ||
// Audio context
// -------------

let SINGLE_AUDIO_NODE = false
let SINGLE_AUDIO_NODE = IS_SAFARI


export function usesSingleAudioNode() {
Expand Down Expand Up @@ -126,7 +126,10 @@ export function insertTrack(orchestrion, queueItem, maybeArtwork) {
queueItem =
Object.assign({}, queueItem, { url: url })

if ((audioNode = audioElementsContainer.querySelector("audio")) && SINGLE_AUDIO_NODE) {
audioNode =
audioElementsContainer.querySelector("audio")

if (SINGLE_AUDIO_NODE && audioNode) {
audioNode.setAttribute("src", queueItem.url)
audioNode.setAttribute("rel", queueItem.trackId)
audioNode.load()
Expand Down

0 comments on commit 5225c48

Please sign in to comment.