Page MenuHomePhabricator

Update mobileapps to handle <audio> tags
Closed, ResolvedPublic


Parsoid HTML will be changing to use <audio> rather than <video> tags for elements wrapping audio files. In mobileapps this will require changes to the media and summary endpoints and to the anchorPopupMediaTransform (and possibly more).

Parsoid patch:

Event Timeline

We definitely need to change the media endpoint implementation.

TypeError: Cannot read property 'source' of undefined
at _.uniq.elem (/Users/besi/de/wmf/mobileapps/lib/media.js:163:65)
at Function._.uniq._.unique (/Users/besi/de/wmf/mobileapps/node_modules/underscore/underscore.js:581:33)
at Object.getMediaItemInfoFromPage (/Users/besi/de/wmf/mobileapps/lib/media.js:163:14)
at BBPromise.join (/Users/besi/de/wmf/mobileapps/routes/page/media.js:23:39)

Change 450896 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] media: get ready for audio tag

@Mholloway I've fixed the issues in the media endpoint.
But it's unclear what the other issues are:

  • I don't think the summary endpoint deals with audio at all.
  • anchorPopupMediaTransform (used for the mobile-sections endpoints) deals with video only. It's using a selector of *[typeof^=mw:Video] video, which still should be fine.

Hey @bearND, the various areas I mentioned were just from grepping through the repo to see where we're using <video> tags in some way—I should probably have been more precise that they were areas needing review and possibly needing change.

I suggested an additional unit test but otherwise your patch looks good.

Change 450896 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] media: get ready for audio tag