Homec4science

Fix two issues with audio macros

Authored by epriestley <git@epriestley.com> on Sep 29 2013, 00:32.

Description

Fix two issues with audio macros

Summary:
Fixes T3887. Two issues:

  • Macros were generating entirely before the render cache, so audio macros worked fine in previews and the first time the cache was populated, but not afterward.
    • Instead, parse them before the cache but drop them in after the cache. Clean up all the file querying, too. This makes cached remarkup generate the correct audio beahviors.
  • Safari sends an HTTP request with a "Range" header, and expects a "206 Partial Content" response. If we don't give it one, it sometimes has trouble figuring out how long a piece of audio is (mostly for longer clips? Or mostly for MP3s?). I'm not exactly sure what triggers it. The net effect is that "loop" does not work when Safari gets confused. While looping a short "quack.wav" worked fine, longer MP3s didn't loop.
    • Supporting "Range" and "206 Partial Content", which is straightforward, fixes this problem.

Test Plan:

  • Viewed a page with lots of different cached audio macros and lots of different uncached preview audio macros, they all rendered correctly and played audio.
  • Viewed a macro with a long MP3 audio loop in Safari. Verified it looped after it completed. Used Charles to check that the server received and responded to the "Range" header correctly.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3887

Differential Revision: https://secure.phabricator.com/D7166

Details

Committed
epriestley <git@epriestley.com>Sep 29 2013, 00:32
Pushed
aubortJan 31 2017, 17:16
Parents
rPHb4cc9906477c: Add "Subscribers" to Maniphest application search
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH0318cadad4c2: Fix two issues with audio macros (authored by epriestley <git@epriestley.com>).Sep 29 2013, 00:32