Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix safari cannot play ts file problem. #188

Merged
merged 1 commit into from
May 22, 2024

Conversation

suzp1984
Copy link
Contributor

Bug:

MacOS safari can't play TS file.

steps to reproduce

  1. clone this project https://github.com/xqq/mpegts.js, and build the project, (check the README).
    npm install; npm install -g webpack-cli; npm run build;
  2. run the webpack serve: npm run serve;
  3. access page http://localhost:8080/arib.html in safari;
  4. find/generate a test.ts file with audio codec as opus;
    e.g. by ffmpeg: ffmpeg -i [file].[aac|opus] -acodec opus test.ts
  5. start a static web server in the folder of test.ts,
    e.g. by this python script: https://gist.github.com/mkows/cd2122f427ea722bf41aa169ef762001
    python server-cors.py 9921
  6. in page http://localhost:8080/arib.html, input Stream URL as: http://127.0.0.1:9921/test.ts, deselect isLive & withCredentials & liveSync checkbox. then click Load button.
  7. the opus audio can not play in safari.

Root Cause

the Safari web browser don't support MIME audio/mp4;codecs=opus, but support audio/mp4;codecs=Opus.

In side safari web dev tools, go to Console tab. Input MediaSource.isTypeSupported('audio/mp4;codecs=opus') and MediaSource.isTypeSupported('audio/mp4;codecs=Opus') to verify.

@xqq
Copy link
Owner

xqq commented May 22, 2024

Thank you!

@xqq xqq merged commit a98ab4b into xqq:master May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants