Open bbcai opened 5 years ago
home键回来后没有继续播放看log是因为AUDIOFOCUS_LOSS ,然后执行了releaseAllVideos
03-28 08:44:32.214 23877-23877/com.gwm.app.shortvideo I/JiaoZiVideoPlayer: onClick start [50058259] 03-28 08:44:32.216 23877-23877/com.gwm.app.shortvideo I/MediaPlayer: [HSM] stayAwake true uid: 10116, pid: 23877 03-28 08:44:32.217 23877-23877/com.gwm.app.shortvideo I/MediaPlayer: Pid:23877 MediaPlayer::start 03-28 08:44:32.218 2403-2403/? E/hwcomposer: setGpuBoost:228: Can't open /sys/class/devfreq/gpufreq/max_freq: Permission denied 03-28 08:44:32.220 23877-23877/com.gwm.app.shortvideo D/MediaPlayer: Action:start, CurrentState:MEDIA_PLAYER_STARTED 03-28 08:44:32.220 23877-23888/com.gwm.app.shortvideo D/MediaPlayer: [virtual void android::MediaPlayer::notify(int, int, int, const android::Parcel )] : [1135] callback app listenerNotNull=1, send=1 03-28 08:44:32.220 23877-23888/com.gwm.app.shortvideo D/MediaPlayer: [virtual void android::MediaPlayer::notify(int, int, int, const android::Parcel )] : [1139] callback application 03-28 08:44:32.221 23877-23877/com.gwm.app.shortvideo I/JiaoZiVideoPlayer: onStatePlaying [50058259] 03-28 08:44:32.221 23877-23877/com.gwm.app.shortvideo I/JiaoZiVideoPlayer: startProgressTimer: [50058259] 03-28 08:44:32.224 13871-25795/? I/APM::AudioPolicyManager: setOutputDevice() createAudioPatch returned 0 patchHandle 10463 num_sources 1 num_sinks 1 03-28 08:44:32.226 23877-23991/com.gwm.app.shortvideo D/MediaPlayer: Message: Unknown MediaEventType(6), ext1=0, ext2=0x0 03-28 08:44:32.234 23877-23877/com.gwm.app.shortvideo I/ActivityManager_activity: Resuming ActivityRecord{6d2a599 token=android.os.BinderProxy@5276ee0 {com.gwm.app.shortvideo/com.gwm.mod.shortvideo.ui.activity.MainActivity}} with isForward=false,forwardBitChanged=false onlyLocalRequest=false
03-28 08:44:32.262 3163-3174/? I/MediaFocusControl: AudioFocus requestAudioFocus() from android.media.AudioManager@531968a req=1flags=0x0 03-28 08:44:32.263 23877-23877/com.gwm.app.shortvideo I/AudioManager: requestAudioFocus() status : 1 03-28 08:44:32.263 23877-23877/com.gwm.app.shortvideo I/AudioManager: requestAudioFocus() apk : com.gwm.app.shortvideo 03-28 08:44:32.264 13871-13913/? I/IAudioFlinger: [onTransact]SET_LOWPOWERAPK 03-28 08:44:32.265 3163-3536/? D/InputDispatcher: Dispatch frozen. Waiting some more. last for 156ms 03-28 08:44:32.268 4551-5110/? D/AppsOperator: audio start : com.gwm.app.shortvideo 03-28 08:44:32.269 23877-23877/com.gwm.app.shortvideo W/MediaPlayer: Couldn't open file on client side; trying server side: java.io.FileNotFoundException: No content provider: http://127.0.0.1:56638/http%3A%2F%2Ftxmov2.a.yximgs.com%2Fbs2%2FnewWatermark%2FMTE2MjQ3MjgwMjU_zh_3.mp4 03-28 08:44:32.269 23877-23877/com.gwm.app.shortvideo I/MediaPlayer: setDataSource(http://127.0.0.1:56638/http%3A%2F%2Ftxmov2.a.yximgs.com%2Fbs2%2FnewWatermark%2FMTE2MjQ3MjgwMjU_zh_3.mp4) 03-28 08:44:32.269 13871-13912/? I/MediaPlayerService: #offload:[Client:679]#, application name: com.gwm.app.shortvideo, strlen:22 03-28 08:44:32.270 13871-13871/? D/NuPlayer: codec of amr-wb is disabled! 03-28 08:44:32.271 13871-13871/? D/NuPlayer: hw fadein is disabled! 03-28 08:44:32.272 2403-2403/? E/HAL: load: id=gralloc != hmi->id=gralloc 03-28 08:44:32.273 13871-25867/? D/NuPlayer: onSetVideoSurface(0xab42e0b0, no video decoder) 03-28 08:44:32.399 23877-23991/com.gwm.app.shortvideo D/MediaPlayer: Message: MEDIA_SET_VIDEO_SIZE(5), ext1=720, ext2=1280 03-28 08:44:32.399 23877-23991/com.gwm.app.shortvideo D/MediaPlayer: [virtual void android::MediaPlayer::notify(int, int, int, const android::Parcel )] : [1135] callback app listenerNotNull=1, send=1 03-28 08:44:32.399 2403-2403/? E/hwcomposer: setGpuBoost:228: Can't open /sys/class/devfreq/gpufreq/max_freq: Permission denied 03-28 08:44:32.399 23877-23991/com.gwm.app.shortvideo D/MediaPlayer: [virtual void android::MediaPlayer::notify(int, int, int, const android::Parcel )] : [1139] callback application 03-28 08:44:32.399 23877-23991/com.gwm.app.shortvideo D/MediaPlayer: Message: MEDIA_BUFFERING_UPDATE(3), ext1=2, ext2=0x0 03-28 08:44:32.399 23877-23991/com.gwm.app.shortvideo D/MediaPlayer: [virtual void android::MediaPlayer::notify(int, int, int, const android::Parcel )] : [1135] callback app listenerNotNull=1, send=1 03-28 08:44:32.399 23877-23991/com.gwm.app.shortvideo D/MediaPlayer: [virtual void android::MediaPlayer::notify(int, int, int, const android::Parcel )] : [1139] callback application 03-28 08:44:32.583 23877-23877/com.gwm.app.shortvideo D/AudioManager: AudioManager dispatching onAudioFocusChange(-1) for android.media.AudioManager@531968acn.jzvd.JZVideoPlayer$1@bca48fc 03-28 08:44:32.583 2403-4892/? I/[Gralloc]: alloc w[1280] h[1440] format[1] usage[3842] 03-28 08:44:32.583 23877-23877/com.gwm.app.shortvideo D/JiaoZiVideoPlayer: releaseAllVideos 03-28 08:44:32.583 23877-23877/com.gwm.app.shortvideo I/JiaoZiVideoPlayer: onCompletion [50058259] 03-28 08:44:32.583 23877-23877/com.gwm.app.shortvideo I/JiaoZiVideoPlayer: onStateNormal [50058259] 03-28 08:44:32.585 23877-23877/com.gwm.app.shortvideo I/AudioManager: abandonAudioFocus 03-28 08:44:32.585 3163-4209/? I/MediaFocusControl: AudioFocus abandonAudioFocus() from android.media.AudioManager@531968acn.jzvd.JZVideoPlayer$1@bca48fc 03-28 08:44:32.585 3163-4209/? I/MediaFocusControl: AudioFocus removeFocusStackEntry(): removing entry for android.media.AudioManager@531968acn.jzvd.JZVideoPlayer$1@bca48fc 03-28 08:44:32.586 13871-13871/? I/IAudioFlinger: [onTransact]SET_LOWPOWERAPK 03-28 08:44:32.588 2403-4892/? I/[Gralloc]: alloc succ handle[0x55877430f0] stride[1280] 03-28 08:44:32.590 2403-2474/? D/SurfaceFlinger: HWComposer setOrientation = 0 03-28 08:44:32.590 2403-2474/? I/SurfaceFlinger: set Mirror VirtualDisplay orientation = 0 03-28 08:44:32.662 23877-23877/com.gwm.app.shortvideo D/JiaoZiVideoPlayer: AUDIOFOCUS_LOSS [197806332]
首先要确定demo是不是有问题,然后你的用法是不是正确,你做了哪些改动
home键暂停回来后继续播放没有调用onSurfaceTextureAvailable,导致不能播放,再次点击后才能播放,有时点击也不播放,就一直在准备状态,请问下没有调用onSurfaceTextureAvailable这个问题一般怎么解决呢,谢谢