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

iPhone, iPad で音が再生されない場合の対処 #197

Open
simiraaaa opened this issue May 9, 2017 · 0 comments
Open

iPhone, iPad で音が再生されない場合の対処 #197

simiraaaa opened this issue May 9, 2017 · 0 comments

Comments

@simiraaaa
Copy link
Contributor

tipsとして、こちらに挙げておきます。
iPhoneで音が再生されない原因はiOSがブラウザ上で音の再生をユーザの操作時に限定しているからです。
一度、再生できればそのあとは再生できるので、初めのタッチでダミーの音を再生するように次のコードを app.run() の前に追加してみてください

app.domElement.addEventListener('touchend', function dummy() {
  var s = phina.asset.Sound();
  s.loadFromBuffer();
  s.play().stop();
  app.domElement.removeEventListener('touchend', dummy);
});
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

No branches or pull requests

1 participant