簡體   English   中英

應用在某些設備上無法使用

[英]app was not working in some of devices

我開發了一個應用程序。 我的應用程序包括視頻錄制和播放。

我必須播放從手機錄制的視頻。 這適用於大多數設備(Samsung galaxy ace,Motorola Droid x, etc.,) ,而不適用於某些設備(Droid x2,Nexus,etc.,)

我使用以下代碼進行視頻播放

String temp_path=Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)+"/MySaveCellData/dbz_115.3gp";
    //Toast.makeText(this,getSaveCellPath(),Toast.LENGTH_LONG).show();
    if(temp_path!=null) {
            //int width = myView.getMeasuredWidth();
          //  int height = myView.getMeasuredHeight();
            //we add 10 pixels to the current size of the video view every time you touch     
            //the media controller.
        Display display = getWindowManager().getDefaultDisplay(); 
        int width = display.getWidth();
        int height = display.getHeight();
        MediaController mediaController = new MediaController(this);
        mediaController.setAnchorView(myView);
        myView.setMediaController(mediaController);

        myView.setKeepScreenOn(true);

        //myView.setVideoAspect(width,height);
        //myView.setVideo
        myView.setVideoPath(temp_path);
        myView.start();
        myView.requestFocus();
    }
    else 
        Toast.makeText(this,"Video Path Not Found, or is set to null",Toast.LENGTH_LONG).show();        
}

誰能告訴我問題和解決方案。

提前致謝。

最好的祝福。

問題不在於視頻播放。視頻錄制中的問題。當我錄制視頻時,設備的硬件不支持我的代碼。 所以我更改了錄像機的代碼。 它在所有設備上都運行良好。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM