Bug 243912 - Certain TikTok sound previews are broken
Summary: Certain TikTok sound previews are broken
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-08-12 18:31 PDT by Youssef Soliman
Modified: 2024-01-14 03:29 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Youssef Soliman 2022-08-12 18:31:45 PDT
Any TikTok sound generated from an originally uploaded video (not submitted as a separate audio) is not handled properly by our media pipeline.

The issue arises from TikTok making a request for an `audio/mpeg`, while the server responds back with a MIME type of `video/mp4` and response body containing an `mp3` file.

Downloading the file locally, you can see that renaming the file extension to `mp3` and opening it in Safari will play normally.

A fix for this might involve inferring the type separately and falling back to that media type if the initial load is unsuccessful.

Example of broken audio
Link to sound: https://www.tiktok.com/music/original-sound-7089077221968595755
Direct audio file link: https://v16m.tiktokcdn.com/9b85c36eb6ee5af4270d709d3bc99129/62f7515f/video/tos/maliva/tos-maliva-v-27dcd7c799-us/662ea36d360b41539e8b0fc113ebefc7/
Comment 1 Radar WebKit Bug Importer 2022-08-12 18:32:04 PDT
<rdar://problem/98596397>
Comment 2 Jer Noble 2022-08-13 11:44:58 PDT
Modifying the source of that page so that the <video> element has a <source> tag with a 'type="audio/mpeg"' attribute causes the page to load correctly.

<video class="" playsinline="true" x5-playsinline="true" webkit-playsinline="true" tabindex="2" mediatype="video">
<source src="https://v16m.tiktokcdn.com/9d1d39b4d82b9f45898221476afe4b7e/62f844a7/video/tos/maliva/tos-maliva-v-27dcd7c799-us/662ea36d360b41539e8b0fc113ebefc7/?a=1233&amp;ch=0&amp;cr=0&amp;dr=0&amp;er=3&amp;cd=0%7C0%7C0%7C0&amp;br=250&amp;bt=125&amp;ft=ApCEgBnZqq2mo0PZ9YyfkVQZ2TJw_KJ&amp;mime_type=audio_mpeg&amp;qs=6&amp;rc=NDY2ZzZoZDQ8M2RnZDdkNUBpM2c0O2c6ZmpxPDMzZzU8NEAtLmM1YjMvNTYxYS0vL2M0YSNeLl5ncjRfYGRgLS1kMS9zcw%3D%3D&amp;l=202208131840460101921662191132E5D9&amp;btag=80000&amp;cc=3" type="audio/mpeg">
</video>
Comment 3 Jer Noble 2022-08-13 11:45:29 PDT
May want to consider suggesting that workaround to TikTok.