Page MenuHomePhabricator

Phonos doesn't play in the Reference Tooltips gadget's popups
Open, MediumPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

image.png (404×152 px, 15 KB)

What happens?:
A page with an audio opens and then the audio plays.

What should have happened instead?:
The audio should play in place.

Technical details:
I see this code to be responsible for the initial click handling:

image.png (500×215 px, 18 KB)

Reference Tooltips, for its part, uses jQuery's .clone() method, more precisely .clone(true), which should clone event handlers as well. But it clones only jQuery's event handlers, not natively (via addEventListener()) added event handlers.

So why not use jQuery, especially given that it is used in the rest of the code? 🤔

(It could be not the whole of the issue.)

Interestingly, the media plays if I first play it in the "References" section, then in the tooltip.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
thiemowmde lowered the priority of this task from Medium to Low.EditedJun 6 2024, 7:40 AM

Moved to T366324#9866856.

Jack_who_built_the_house raised the priority of this task from Low to Medium.EditedJun 6 2024, 8:57 AM

@thiemowmde Don't you think this should be addressed by Phonos first of all? Reference Previews doesn't copy the JavaScript handler – that's fine if that's intended behavior. But the problem is that any JavaScript extension/gadget/user script that is able to show a popup with that content can't have the audio play in-place that even if it wanted. To my knowledge, there is no way to get or clone natively added event listeners to an element.

I intended this task as agnostic of which popup feature is used. So I'll restore the priority implying it is set for Phonos. Here, I created a task specifically for Reference Previews: T366775: Phonos doesn't play in Reference Previews oh, it already exists T366324: Inline links to audio in Reference Previews should not open their media page.

Jack_who_built_the_house renamed this task from Phonos doesn't play in reference tooltips to Phonos doesn't play in popups.Jun 6 2024, 8:57 AM
Jack_who_built_the_house updated the task description. (Show Details)
Nardog renamed this task from Phonos doesn't play in popups to Phonos doesn't play in reference tooltips.Jun 6 2024, 9:06 AM
Nardog removed a project: Reference Previews.

If ReferenceTooltips copies elements preserving handlers using jQuery, the problem is simply that Phonos uses not $.fn.on() but addEventListener(). If Reference Previews does not preserve handlers, switching to $.fn.on() will not be enough to solve the issue. They seem to require different solutions.

thiemowmde renamed this task from Phonos doesn't play in reference tooltips to Phonos doesn't play in the Reference Tooltips gadget's popups.Jun 6 2024, 9:44 AM
thiemowmde updated the task description. (Show Details)
thiemowmde removed a subscriber: Lina_Farid_WMDE.