조회 수 4924 추천 수 0 댓글 2
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

소스(java) 코드

import android.app.Activity; 
import android.net.Uri; 
import android.os.Bundle; 
import android.widget.MediaController; 
import android.widget.VideoView;

public class main extends Activity
{
  private static final String MOVIE_URL = "https://hooni.net/s_512kb.mp4";

  @Override
  public void onCreate(Bundle savedInstanceState)
  {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.video);
    
    VideoView videoView = (VideoView) findViewById(R.id.VideoView);
    MediaController mediaController = new MediaController(this);
    mediaController.setAnchorView(videoView);
    // Set video link (mp4 format )
    Uri video = Uri.parse(MOVIE_URL);
    videoView.setMediaController(mediaController);
    videoView.setVideoURI(video);
    videoView.requestFocus();
    videoView.start();
  }
}


레이아웃(xml) 코드

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout android:id="@+id/LinearLayout01"
  android:layout_height="fill_parent"
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:paddingLeft="2px" android:paddingRight="2px"
  android:paddingTop="2px" android:paddingBottom="2px"
  android:layout_width="fill_parent"
  android:orientation="vertical">

    <VideoView android:layout_height="fill_parent"
      android:layout_width="fill_parent"
      android:id="@+id/VideoView">
  </VideoView>

</LinearLayout>

[출처] http://hekamedia.egloos.com/3551068

?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
1093 System/OS [macos] How to Fix ‘You Shut Down Your Computer Because of a Problem’ file hooni 2022.06.01 972
1092 Develop [c] 이진 탐색 두 가지 코드 (재귀/반복) file hooni 2015.06.26 976
1091 Develop [ios] UIWebView에서 로컬에 있는 html 파일 불러오기 hooni 2015.02.10 978
1090 PPT [ppt] Information Security 발표 자료 (@Team Study 2012.11.15) file hooni 2015.07.22 979
1089 Develop [ios] iOS 8 개발자가 우선 알아야 할 3가지 file hooni 2014.10.02 984
1088 Develop [android] AlertDialog 메시지 창 띄우기 hooni 2015.07.09 985
1087 Develop [js] 좋은 강연자료 & UI 자료 hooni 2014.10.06 992
1086 Etc 수리통계학 : 표본공간과 사상-1 hooni 2015.04.20 992
1085 PPT [ppt] iOS 플라랩#02(2015.03.19) 발표 자료 file hooni 2015.04.24 992
1084 Develop [ios] APNS에 사용할 인증서 만들기 (KeyChain에 있는 인증서 Export) file hooni 2015.01.03 993
1083 System/OS 개인적으로 쓰고 있는 bash_profile hooni 2015.01.16 994
1082 Develop [kotlin] 코틀린 안드로이드 앱 버전/빌드 정보 hooni 2020.12.15 994
1081 Develop [ios] ViewController Push할 때 애니메이션 효과 hooni 2015.10.23 998
1080 System/OS [linux] The Ultimate Wget Download Guide With 15 Awesome Examples hooni 2020.05.26 998
1079 PPT [ppt] Equation Solving 발표 자료 (@AjaxUI랩 밋업데이 2012.02.28) file hooni 2015.07.22 1009
1078 Develop [c] RSA 암호화 구현(gmp 라이브러리 활용) file hooni 2016.10.03 1017
Board Pagination Prev 1 4 5 6 7 8 ... 74 Next
/ 74