Highlighted

Event listener switch speaker - headset on android

Explorer ,
Jan 16, 2017

Copy link to clipboard

Copied

How can I track the moment of switching headphone to speakers in Android?

I want this moment to put music on pause in the app.

Thank you.

TOPICS
Development

Views

289

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Event listener switch speaker - headset on android

Explorer ,
Jan 16, 2017

Copy link to clipboard

Copied

How can I track the moment of switching headphone to speakers in Android?

I want this moment to put music on pause in the app.

Thank you.

TOPICS
Development

Views

290

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jan 16, 2017 0
Adobe Employee ,
Jan 16, 2017

Copy link to clipboard

Copied

Hi Maxxtr,

The following code switches between modes:

SoundMixer.audioPlaybackMode = _useLoudspeaker ? AudioPlaybackMode.MEDIA : AudioPlaybackMode.VOICE;

Please read more about Sound Mixer class through below link:

SoundMixer - Adobe ActionScript® 3 (AS3 ) API Reference

Thanks,

Adobe AIR Team

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 16, 2017 0
maxxtr LATEST
Explorer ,
Jan 17, 2017

Copy link to clipboard

Copied

Thank you deesharm.

I don't understand this code. How to track a moment of a mode switching?

The moment a user disables his headphones off the Android device.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 17, 2017 0