2012-02-03 1 views

답변

5

스트리밍을 위해 다음 방법을 통해 외부 비디오 플레이어를 시작할 수도 있습니다. 사용 가능한 비디오 플레이어 목록을 표시하고, 자신이 선택한 모든 플레이어를 선택할 수 있습니다.

private static void executeIntentForplayVideo(String localPath, 
     LTDCommonData ltdCommonData, final Context activity) { 

    final Intent intent = new Intent(); 
    intent.setAction(android.content.Intent.ACTION_VIEW); 
    // Stream from remote path 
    intent.setDataAndType(Uri.parse(finalPath), "video/*"); 
    //play from sd-card 
    // intent.setDataAndType(Uri.fromFile(file), "video/*"); 
    try { 
     List<ResolveInfo> intents = activity.getPackageManager() 
     .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); 
     if (intents != null && intents.size() > 0) { 

      activity.startActivity(intent); 

     } else { 
      Toast toast = Toast.makeText(activity,"Please download a video player" , Toast.LENGTH_SHORT); 
      toast.show(); 

     } 
    } catch (Exception e) { 
     e.printStackTrace(); 
    } 
} 
관련 문제