谷歌Android音乐应用停止时,我的介绍视频播放 [英] Android Google Music app stops when my intro video plays

查看:313
本文介绍了谷歌Android音乐应用停止时,我的介绍视频播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用在我的Andr​​oid应用程序VideoView显示介绍动画。

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

如果谷歌的音乐应用程序正在播放的背景音乐,呼吁videoview.start()停在谷歌音乐应用音乐播放的背景。

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

有没有一种方法,以确保所有的背景音乐将保持在同一时间与我的介绍视频播放? (它没有音频)

Is there a way to make sure any music in the background will keep playing at the same time with my intro video? (it has no audio)

感谢您!

推荐答案

原来谷歌音乐应用和其他一些应用程序时的视频开始播放将停止他们的音乐。

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.

要做到这一点:

AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);

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

这篇关于谷歌Android音乐应用停止时,我的介绍视频播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆