📲 Android Video SDK. Stream's versatile Core + Compose UI component libraries that allow you to build video calling, audio room, and, live streaming apps based on Webrtc running on Stream's global edge network.
Make sound-related operations thread safe in CallService to avoid race conditions related to object instantiation, playing/stopping sounds and cleaning resources.
🛠Implementation details
Synchronized mediaPlayer and ringtone object creation.
Synchronized property and method access for these objects
Marking object references with @Volatile is not needed, as both the instantiation and subsequent operations are synchronized, which takes care of visibility across threads.
🎯 Goal
Make sound-related operations thread safe in
CallService
to avoid race conditions related to object instantiation, playing/stopping sounds and cleaning resources.🛠Implementation details
mediaPlayer
andringtone
object creation.@Volatile
is not needed, as both the instantiation and subsequent operations aresynchronized
, which takes care of visibility across threads.