Autore Topic: Problema streaming video  (Letto 652 volte)

Offline MisterAnt

  • Utente normale
  • ***
  • Post: 272
  • Respect: +4
    • IlSikano
    • Mostra profilo
  • Dispositivo Android:
    Galaxy S4 Active,Galaxy SIII I9300, Galaxy Tab GT-P5100
  • Play Store ID:
    MisterAnt
  • Sistema operativo:
    Ubuntu 12.04/Winzoz 7/Winzoz xp
Problema streaming video
« il: 29 Novembre 2013, 14:22:30 CET »
0
Salve a tutti =)
Ho implementato una webView per mostrare siti web/streamign video ma ogni tanto mi genera un errore random...
Qualche aiutino?
Java
Codice (Java): [Seleziona]
MESSAGE_ERROR=0;
                                        a=new ConnectedThread();//scarico la pagina web
                                        a.start();
                                        mVideoView.setVideoPath(pathVideo);                    
                                        mVideoView.start();
                                        stopVideo=(Button)findViewById(R.id.stopVideo);
                                        stopVideo.setText(R.string.stop_video);
                                        stopVideo.setBackgroundResource(R.drawable.black_menu_btn);
                                        stopVideo.getBackground().setAlpha(45);
                                        stopVideo.setOnClickListener(new OnClickListener() {
                                                public void onClick(View v) {
                                                        CloseConnection();             
                                                }
                                        });//
                                        mVideoView.requestFocus();
                                        mVideoView.setOnErrorListener(new OnErrorListener() {
                                          @SuppressLint("SetJavaScriptEnabled")
                                          public boolean onError(MediaPlayer mp, int what, int extra) {//pagina web
                                                try{
                                                        setContentView(R.layout.show_web);
                                                        myWebView = (WebView) findViewById(R.id.webview);
                                                        myWebView.getSettings().setJavaScriptEnabled(true);
                                                        timer_stream=Integer.parseInt(stream);
                                                        myWebView.getSettings().setPluginState(WebSettings.PluginState.ON);
                                                        myWebView.getSettings().setBuiltInZoomControls(true);
                                                        myWebView.setWebViewClient(new MyWebViewClient());
                                                        try{
                                                                myWebView.loadUrl(percorso);
                                                        }catch(Exception nn){
                                                                MESSAGE_ERROR=1;
                                                                CloseConnection();
                                                        }
                                                        stopp=(Button)findViewById(R.id.buttonStopp);
                                                        stopp.setText(R.string.stop_video);
                                                        stopp.setBackgroundResource(R.drawable.black_menu_btn);
                                                        stopp.getBackground().setAlpha(45);
                                                        stopp.setOnClickListener(new OnClickListener() {
                                                                public void onClick(View v) {
                                                                        CloseConnection();
                                                                }
                                                        });
                                                }catch(Exception bb){
                                                        Log.e("VidoePlayer Error", "e:"+bb);
                                                        MESSAGE_ERROR=1;
                                                }
                                                return true;
                                        }
                                  });
/////////////////////////////////////////////////////////////////////
 @SuppressLint("SetJavaScriptEnabled")
        private class MyWebViewClient extends WebViewClient {
        @Override
        public boolean shouldOverrideUrlLoading(WebView myWebView, String url) {
                try{
                        myWebView.getSettings().setJavaScriptEnabled(true);
                        Button stopp=(Button)findViewById(R.id.buttonStopp);
                        stopp.setBackgroundResource(R.drawable.black_menu_btn);
                        stopp.getBackground().setAlpha(45);
                        timer_stream=0;//
                        myWebView.getSettings().setPluginState(WebSettings.PluginState.ON);
                        myWebView.getSettings().setBuiltInZoomControls(true);
                        myWebView.loadUrl(url);
                        stopp.setOnClickListener(new OnClickListener() {
                                public void onClick(View v) {
                                        CloseConnection();
                                }
                        });
                }catch(Exception bb){
                        Log.i("MyWebViewClient class","E:"+bb);
                }
                        return true;
        }
    }


LogCat
Codice: [Seleziona]
11-29 02:14:25.023: E/MediaPlayer(18483): error (1, -2147483648)
11-29 02:14:25.033: D/MediaPlayer(18483): Couldn't open file on client side, trying server side
11-29 02:14:25.233: W/VideoView(18483): Unable to open content: http://www.google.it
11-29 02:14:25.233: W/VideoView(18483): java.lang.IllegalArgumentException: The surface has been released
11-29 02:14:25.233: W/VideoView(18483):         at android.media.MediaPlayer._setVideoSurface(Native Method)
11-29 02:14:25.233: W/VideoView(18483):         at android.media.MediaPlayer.setDisplay(MediaPlayer.java:668)
11-29 02:14:25.233: W/VideoView(18483):         at android.widget.VideoView.openVideo(VideoView.java:236)
11-29 02:14:25.233: W/VideoView(18483):         at android.widget.VideoView.access$2000(VideoView.java:51)
11-29 02:14:25.233: W/VideoView(18483):         at android.widget.VideoView$6.surfaceCreated(VideoView.java:478)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.SurfaceView.updateWindow(SurfaceView.java:623)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.SurfaceView.setFrame(SurfaceView.java:298)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.View.layout(View.java:13770)
11-29 02:14:25.233: W/VideoView(18483):         at android.widget.RelativeLayout.onLayout(RelativeLayout.java:948)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.View.layout(View.java:13772)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.ViewGroup.layout(ViewGroup.java:4365)
11-29 02:14:25.233: W/VideoView(18483):         at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.View.layout(View.java:13772)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.ViewGroup.layout(ViewGroup.java:4365)
11-29 02:14:25.233: W/VideoView(18483):         at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649)
11-29 02:14:25.233: W/VideoView(18483):         at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1507)
11-29 02:14:25.233: W/VideoView(18483):         at android.widget.LinearLayout.onLayout(LinearLayout.java:1420)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.View.layout(View.java:13772)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.ViewGroup.layout(ViewGroup.java:4365)
11-29 02:14:25.233: W/VideoView(18483):         at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.View.layout(View.java:13772)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.ViewGroup.layout(ViewGroup.java:4365)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1874)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1695)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1006)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4220)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.Choreographer.doCallbacks(Choreographer.java:555)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.Choreographer.doFrame(Choreographer.java:525)
11-29 02:14:25.233: W/VideoView(18483):         at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
11-29 02:14:25.233: W/VideoView(18483):         at android.os.Handler.handleCallback(Handler.java:615)
11-29 02:14:25.233: W/VideoView(18483):         at android.os.Handler.dispatchMessage(Handler.java:92)
11-29 02:14:25.233: W/VideoView(18483):         at android.os.Looper.loop(Looper.java:137)
11-29 02:14:25.233: W/VideoView(18483):         at android.app.ActivityThread.main(ActivityThread.java:4745)
11-29 02:14:25.233: W/VideoView(18483):         at java.lang.reflect.Method.invokeNative(Native Method)
11-29 02:14:25.233: W/VideoView(18483):         at java.lang.reflect.Method.invoke(Method.java:511)
11-29 02:14:25.233: W/VideoView(18483):         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-29 02:14:25.233: W/VideoView(18483):         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-29 02:14:25.233: W/VideoView(18483):         at dalvik.system.NativeStart.main(Native Method)
11-29 02:14:25.233: D/VideoView(18483): Error: 1,0
11-29 02:14:25.263: D/AndroidRuntime(18483): Shutting down VM
11-29 02:14:25.263: W/dalvikvm(18483): threadid=1: thread exiting with uncaught exception (group=0x413ce300)
11-29 02:14:25.273: E/AndroidRuntime(18483): FATAL EXCEPTION: main
11-29 02:14:25.273: E/AndroidRuntime(18483): java.lang.NullPointerException
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.SurfaceView.updateWindow(SurfaceView.java:656)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.SurfaceView.setFrame(SurfaceView.java:298)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.View.layout(View.java:13770)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.widget.RelativeLayout.onLayout(RelativeLayout.java:948)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.View.layout(View.java:13772)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.ViewGroup.layout(ViewGroup.java:4365)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.View.layout(View.java:13772)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.ViewGroup.layout(ViewGroup.java:4365)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1507)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.widget.LinearLayout.onLayout(LinearLayout.java:1420)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.View.layout(View.java:13772)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.ViewGroup.layout(ViewGroup.java:4365)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.View.layout(View.java:13772)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.ViewGroup.layout(ViewGroup.java:4365)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1874)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1695)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1006)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4220)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.Choreographer.doCallbacks(Choreographer.java:555)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.Choreographer.doFrame(Choreographer.java:525)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.os.Handler.handleCallback(Handler.java:615)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.os.Handler.dispatchMessage(Handler.java:92)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.os.Looper.loop(Looper.java:137)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at android.app.ActivityThread.main(ActivityThread.java:4745)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at java.lang.reflect.Method.invokeNative(Native Method)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at java.lang.reflect.Method.invoke(Method.java:511)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-29 02:14:25.273: E/AndroidRuntime(18483):         at dalvik.system.NativeStart.main(Native Method)
11-29 02:14:25.303: V/WebRequest(18483): WebRequest::WebRequest, setPriority = 1
11-29 02:14:25.843: I/dalvikvm(18483): Jit: resizing JitTable from 4096 to 8192
11-29 02:14:27.013: D/ProgressTracker(18483): Progress incremented (0x651e14c0) - value 0.881559, tracked frames 1
11-29 02:14:27.013: D/CachedResourceLoader(18483): request 1, url: http://www.google.it/xjs/_/js/k=xjs.s.en_US.v-r5CthikH8.O/m=c,sb_tab,cr,jp,tic,ivf,tab,bct,elog,r,hsm,j,p,pcc,csi/am=EBIAoQ/rt=j/d=1/sv=1/rs=AItRSTOD3qA2iF3Mj9hZaWHsM--cvhsxww
11-29 02:14:35.673: D/dalvikvm(18483): GC_CONCURRENT freed 1798K, 7% free 33121K/35527K, paused 16ms+3ms, total 60ms
Se le zampe del coniglio sono così fortunate, che fine ha fatto il coniglio?