void mp_player_focus_callback(sound_stream_info_h stream_info, sound_stream_focus_change_reason_e reason_for_change,
const char *additional_info, void *user_data)
{
+ startfunc;
struct appdata *ad = user_data;
sound_stream_focus_state_e state_for_playback;
sound_manager_set_focus_reacquisition(ad->stream_info, EINA_FALSE);
}
} else {
- if (ad->stream_info) {
+ if (ad->stream_info && !g_strcmp0(additional_info, "cam_capture")) {
ret = sound_manager_release_focus(ad->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
if (ret != SOUND_MANAGER_ERROR_NONE) {
ERROR_TRACE("failed to release focus error[%x]", ret);
struct appdata *ad = mp_util_get_appdata();
MP_CHECK(ad);
+ if (_mp_is_current_focus_available(ad) != 0) {
+ ERROR_TRACE("Some other application has the focus currently... Returning...");
+ return;
+ }
+
MpPlayerView_t *view = (MpPlayerView_t *)data;
MP_CHECK(view);
struct appdata *ad = mp_util_get_appdata();
MP_CHECK(ad);
- int ret = SOUND_MANAGER_ERROR_NONE;
- int playback_flag = SOUND_BEHAVIOR_NONE;
- char *additional_info = NULL;
- int changed_by = SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA;
- ret = sound_manager_get_current_playback_focus(&changed_by, &playback_flag, &additional_info);
- if (ret != SOUND_MANAGER_ERROR_NONE) {
- ERROR_TRACE("Cannot determine current playback focus");
- }
-
- DEBUG_TRACE("Changed by : %d", changed_by);
- if (changed_by == SOUND_STREAM_FOCUS_CHANGED_BY_CALL || changed_by == SOUND_STREAM_FOCUS_CHANGED_BY_VOIP || changed_by == SOUND_STREAM_FOCUS_CHANGED_BY_RINGTONE) {
- DEBUG_TRACE("Cannot resume Music Player due to call... Changing state in paused state...");
+ if (_mp_is_current_focus_available(ad) != 0) {
+ ERROR_TRACE("Some other application has the focus currently... Changing state in paused state...");
ad->paused_by_user = TRUE;
}
struct appdata *ad = mp_util_get_appdata();
MP_CHECK(ad);
- int ret = SOUND_MANAGER_ERROR_NONE;
- int playback_flag = SOUND_BEHAVIOR_NONE;
- char *additional_info = NULL;
- int changed_by = SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA;
- ret = sound_manager_get_current_playback_focus(&changed_by, &playback_flag, &additional_info);
- if (ret != SOUND_MANAGER_ERROR_NONE) {
- ERROR_TRACE("Cannot determine current playback focus");
- }
-
- DEBUG_TRACE("Changed by : %d", changed_by);
- if (changed_by == SOUND_STREAM_FOCUS_CHANGED_BY_CALL || changed_by == SOUND_STREAM_FOCUS_CHANGED_BY_VOIP || changed_by == SOUND_STREAM_FOCUS_CHANGED_BY_RINGTONE) {
- DEBUG_TRACE("Cannot resume Music Player due to call... Changing state in paused state...");
+ if (_mp_is_current_focus_available(ad) != 0) {
+ ERROR_TRACE("Some other application has the focus currently... Changing state in paused state...");
ad->paused_by_user = TRUE;
}
struct appdata *ad = mp_util_get_appdata();
MP_CHECK(ad);
+ if (_mp_is_current_focus_available(ad) != 0) {
+ ERROR_TRACE("Some other application has the focus currently... Returning...");
+ return;
+ }
+
ad->hide_player_view = true;
mp_setting_set_nowplaying_id(getpid());
static void _mp_now_playing_btn_pressed_cb(void *data, Evas_Object *obj, void *event_info)
{
DEBUG_TRACE("button pressed");
+
+ struct appdata *ad = mp_util_get_appdata();
+ MP_CHECK(ad);
+
+ if (_mp_is_current_focus_available(ad) != 0) {
+ ERROR_TRACE("Some other application has the focus currently... Changing state in paused state...");
+ ad->paused_by_user = TRUE;
+ }
+
char *source = (char *)data;
if (!g_strcmp0(source, NOW_PLAYING_FF_SOURCE)) {
mp_play_control_ff(true, false, true);