为框架对话框按钮注册OnClickListerner吗?

| 我遇到了一个问题,其中我试图在Android设备中使用RTSP播放流视频。我正在使用videoview,一切正常。在少数设备中,此视频供稿有一些编码问题,无法播放。在这些情况下,视频视图将显示一个对话框,其中带有消息“抱歉无法播放此视频”和“确定”按钮。我想为此OK按钮注册一个OnClickListerner。我没有创建此对话框,所以我的课堂上没有参考。猜猜这个对话框是一个框架。 我需要在此OnclickListerner中执行一些重要操作,因此需要注册到此对话框的“确定”按钮。我该如何实现? 编辑:添加Logcat日志 您会在日志末尾看到MediaPlayer显示一些错误。我有活动工具onErrorListerner,并且确实将活动设置为videoView的onErrorListerner。但是我的errorlisterner仍然没有被召唤...我希望尽快解决这个问题..任何帮助表示赞赏...
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): voStreaming 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)
    
已邀请:
您可以使用
myVideoView.setOnErrorListener(...)
设定自己的
MediaPlayer.OnErrorListener
。默认对话框“抱歉,无法播放视频”不会显示,但是侦听器实例将允许您创建自己的
AlertDialog
(或任何适合您的需要)并处理此对话框上的任何操作。     

要回复问题请先登录注册