Android Google Music app stops when my intro video plays

前端 未结 3 506
被撕碎了的回忆
被撕碎了的回忆 2020-12-18 13:40

I\'m using a VideoView in my Android app to display the intro animation.

If the Google Music App is playing music in the background, calling videoview.start() stops

3条回答
  •  不知归路
    2020-12-18 14:29

    Turns out Google Music App and a few other apps will stop their music when any video starts playing.

    In order to make sure I'm not interrupting the listening experience for my users I now skip the intro video if I determine that there is music playing in the background.

    To do this:

    AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
    
    if (am.isMusicActive()) {
        loadApp();   // skip video and go straight to the app
    }
    else {
        videoView.start();  // play video
    }
    

提交回复
热议问题