I am facing a issue wherein I am trying to play a streaming video using RTSP in the android device. I am using videoview and everything works fine and nice. In few devices this video feed has some encoding problem and doesnt play. In these cases the videoview shows a dialog box with a message "Sorry Cant play this video" and "OK" button. I want to register a OnClickListerner for this OK button. I dont create this dialog box and so I dont have a reference in my class. Guess this dialog box is a framework one.
I need do some important operations in this OnclickListerner so need to register to the OK button of this dialog box. How can I achieve this?
EDIT: Adding Logcat Logs
you cna see at the end of the logs that MediaPlayer is displaying some error. I have my activity implement onErrorListerner and I did set my activity as videoView's onErrorListerner. But still my errorlisterner never gets called... i looking to resolve this issue ASAP.. any help is appreciated...
ERROR/MediaPlayer(4243): onHDMIStateChanged
ERROR/voaEngine(64): @@@VOLOG Info THD AFD4A830: voaEngine.cpp voaInit 22 Flag: 1
ERROR/voaEngine(64): @@@VOLOG Info THD AFD4A830: voaEngine.cpp voaSetParam 66 VOAP_IDF_onFirstRef
ERROR/voaEngine(64): @@@VOLOG Info THD AFD4A830: voaEngine.cpp voaSetParam 70 VOAP_IDF_initCheck
ERROR/CDllLoad(64): @@@VOLOG Info THD AFD4A830: CDllLoad.cpp LoadLib 221 Load module libvoOMXME.so!
ERROR/voaEngine(64): @@@VOLOG Info THD AFD4A830: voaEngine.cpp voaSetParam 74 VOAP_IDF_setDataSourceURL
ERROR/CVOMEPlayer(64): @@@VOLOG Info THD AFD4A830: CVOMEPlayer.cpp SetSource 147 Source: rtsp://a1052.l82402None.c82402.g.lq.akamaistream.net/7/1052/82402/v0001/cnbc.download.akamai.com/23727/sdp_!/apa1.sdp?auth=daEcpc4cOdnbLaAb.d_bnbMcLcwc7cFccc7-bnQmbB-bWG-QYQN&aifp=abcq&reporting=part="E*TRADE FINANCIAL"|parttype=STREAM
ERROR/CVOMEPlayer(64): @@@VOLOG Info THD AFD4A830: CVOMEPlayer.cpp SetSource 193 Count: 1
ERROR/voaEngine(64): @@@VOLOG Info THD 00016C08: voaEngine.cpp voaSetParam 89 VOAP_IDF_prepareAsync
ERROR/voOMXCfg(64): @@@VOLOG Info THD 0001FF38: voCOMXBaseConfig.cpp Open 389 Read 459 bytes
ERROR/voOMXCfg(64): @@@VOLOG Info THD 0001FF38: voCOMXBaseConfig.cpp Open 389 Read 474 bytes
ERROR/voOMXCfg(64): @@@VOLOG Error THD 0001FF38: voCOMXBaseConfig.cpp Open 366 The config file vomeComp_RTSP.cfg could not be opened!
ERROR/CVOMEPlayer(64): @@@VOLOG Info THD 0001FF38: CVOMEPlayer.cpp BuildGraph 387 start to build graph!
ERROR/voCOMXCoreLoader(64): @@@VOLOG Info THD 0001FF38: voCOMXCoreLoader.cpp SetCoreFile 114 OMX Core file is libvoOMXOne.so
ERROR/Util(64): @@@VOLOG Info THD 0001FF38: voCOMXBaseGraph.cpp OMX_mmLoadLib 194 Load libvoOMXOne.so ... 0xb0011ccc
ERROR/voCOMXCoreLoader(64): @@@VOLOG Warning THD 0001FF38: voCOMXCoreLoader.cpp SetCoreFile 163 m_fSetWorkingPath is 0X8121B8B8
ERROR/voOMXCfg(64): @@@VOLOG Error THD 0001FF38: voCOMXBaseConfig.cpp Open 366 The config file vomeOne.cfg could not be opened!
ERROR/voCOMXCoreLoader(64): @@@VOLOG Info THD 0001FF38: voCOMXCoreLoader.cpp OMX_ComponentNameEnum 443 The 0 Component Name is OMX.VisualOn.FileSource
ERROR/voCOMXCoreLoader(64): @@@VOLOG Info THD 0001FF38: voCOMXCoreLoader.cpp OMX_ComponentNameEnum 443 The 1 Component Name is OMX.VisualOn.Audio.Decoder.XXX
ERROR/voCOMXCoreLoader(64): @@@VOLOG Info THD 0001FF38: voCOMXCoreLoader.cpp OMX_ComponentNameEnum 443 The 2 Component Name is OMX.VisualOn.Audio.Sink
ERROR/voCOMXCoreLoader(64): @@@VOLOG Info THD 0001FF38: voCOMXCoreLoader.cpp OMX_ComponentNameEnum 443 The 3 Component Name is OMX.VisualOn.Video.Decoder.XXX
ERROR/voCOMXCoreLoader(64): @@@VOLOG Info THD 0001FF38: voCOMXCoreLoader.cpp OMX_ComponentNameEnum 443 The 4 Component Name is OMX.VisualOn.Video.Sink
ERROR/voCOMXCoreLoader(64): @@@VOLOG Info THD 0001FF38: voCOMXCoreLoader.cpp OMX_ComponentNameEnum 443 The 5 Component Name is OMX.VisualOn.Clock.Time
ERROR/voCOMXCoreLoader(64): @@@VOLOG Info THD 0001FF38: voCOMXCoreLoader.cpp OMX_ComponentNameEnum 443 The 6 Component Name is OMX.VisualOn.G1Video.Capture
ERROR/voCOMXCoreLoader(64): @@@VOLOG Info THD 0001FF38: voCOMXCoreLoader.cpp OMX_ComponentNameEnum 443 The 7 Component Name is OMX.VisualOn.G1Audio.Capture
ERROR/voCOMXCoreLoader(64): @@@VOLOG Info THD 0001FF38: voCOMXCoreLoader.cpp OMX_ComponentNameEnum 443 The 8 Component Name is OMX.VisualOn.Video.Encoder.XXX
ERROR/voCOMXCoreLoader(64): @@@VOLOG Info THD 0001FF38: voCOMXCoreLoader.cpp OMX_ComponentNameEnum 443 The 9 Component Name is OMX.VisualOn.Audio.Encoder.XXX
ERROR/voCOMXCoreLoader(64): @@@VOLOG Info THD 0001FF38: voCOMXCoreLoader.cpp OMX_ComponentNameEnum 443 The 10 Component Name is OMX.VisualOn.FileSink
ERROR/voCOMXCoreLoader(64): @@@VOLOG Info THD 0001FF38: voCOMXCoreLoader.cpp OMX_ComponentNameEnum 443 The 11 Component Name is OMX.VisualOn.DataSource
ERROR/voCOMXCoreLoader(64): @@@VOLOG Info THD 0001FF38: voCOMXCoreLoader.cpp OMX_ComponentNameEnum 443 The 12 Component Name is OMX.VisualOn.Audio.Effect
ERROR/voCOMXCoreLoader(64): @@@VOLOG Info THD 0001FF38: voCOMXCoreLoader.cpp OMX_ComponentNameEnum 443 The 13 Component Name is OMX.VisualOn.Video.Effect
ERROR/(64): @@@VOLOG Error THD 0001FF38: CBaseConfig.cpp Open 373 The config file vommcodec.cfg could not be opened!
ERROR/voCOMXFileSource(64): @@@VOLOG Info THD 0001FF38: voCOMXFileSource.cpp voCOMXFileSource 86 Name OMX.VisualOn.FileSource.
ERROR/CDllLoad(64): @@@VOLOG Info THD 0001FF38: CDllLoad.cpp LoadLib 221 Load module libHTC_mm_property.so!
ERROR/MM_PROPERTY(64): can not match property 'rtspproxyip'
ERROR/CDllLoad(64): @@@VOLOG Info THD 0001FF38: CDllLoad.cpp FreeLib 270 Free module libHTC_mm_property.so!
ERROR/voStreaming(64): voStreamin开发者_C百科g Permission denied,[/data/local/visualonLog_rtsp/],create log directory fails
ERROR/CDllLoad(64): @@@VOLOG Info THD 0001FF38: CDllLoad.cpp LoadLib 221 Load module libvoSrcRTSP.so!
ERROR/CRTSPSource(64): @@@VOLOG Info THD 0001FF38: CRTSPSource.cpp HandleStreamEvent 554 Error Event 3002
ERROR/CRTSPSource(64): @@@VOLOG Error THD 0001FF38: CRTSPSource.cpp LoadSource 255 VOID_STREAMING_OPENURL failed. 0X83000007
ERROR/voCOMXFileSource(64): @@@VOLOG Error THD 0001FF38: voCOMXFileSource.cpp LoadFile 555 m_pSource->LoadSource was failed. 0X83000007
ERROR/voCOMXCompBaseChain(64): @@@VOLOG Error THD 0001FF38: voCOMXCompBaseChain.cpp AddSource 292 ########## File Name is rtsp://..........(purposely hidden)
ERROR/voCOMXCompBaseChain(64): @@@VOLOG Error THD 0001FF38: voCOMXCompBaseChain.cpp AddSource 306 It could not load the source component.
ERROR/Util(64): @@@VOLOG Error THD 0001FF38: voCOMXBaseGraph.cpp Playback 782 m_pChain->AddSource!
ERROR/CVOMEPlayer(64): @@@VOLOG Error THD 0001FF38: CVOMEPlayer.cpp BuildGraph 421 m_fAPI.Playback error
ERROR/CVOMEPlayer(64): @@@VOLOG Error THD 0001FF38: CVOMEPlayer.cpp NotifyOpenSource 342 BuildGraph failed!.
ERROR/MediaPlayer(4243): error (1, -1)
ERROR/MediaPlayer(4243): Error (1,-1)
You can set your own MediaPlayer.OnErrorListener by using myVideoView.setOnErrorListener(...). The default dialog with "Sorry can't play the video" will not be displayed but the listener instance will allow you to create your own AlertDialog (or whatever suits your need) and handle any action on this dialog.
加载中,请稍侯......
精彩评论