Commit ddb060d6 authored by Alex Fandrianto's avatar Alex Fandrianto

Add reference to "mojo:media_service" in sound.dart

Related: https://github.com/domokit/mojo/issues/614

Flutter can play sounds using this package. However, when Mojo Shell is running Flutter, it lacks the necessary media service.

This patch creates a hook to the mojo binary `media_service.mojo`. If Mojo Shell is built with this media service, then it will be able to play sounds when running Flutter.
parent 7fb70ecc
......@@ -67,7 +67,7 @@ class SoundEffectStream {
class SoundEffectPlayer {
SoundEffectPlayer(int maxStreams) {
MediaServiceProxy mediaService = new MediaServiceProxy.unbound();
shell.connectToService(null, mediaService);
shell.connectToService("mojo:media_service", mediaService);
_soundPool = new SoundPoolProxy.unbound();
mediaService.ptr.createSoundPool(_soundPool, maxStreams);
}
......@@ -146,7 +146,7 @@ class SoundTrackPlayer {
SoundTrackPlayer() {
_mediaService = new MediaServiceProxy.unbound();
shell.connectToService(null, _mediaService);
shell.connectToService("mojo:media_service", _mediaService);
}
MediaServiceProxy _mediaService;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment