Contents

Views 4913 Comment 2
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

소스(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
No. Category Subject Author Date Views
217 Develop [js] jQuery 코드 작성시 편리한 HTML 템플릿 hooni 2013.12.17 33111
216 Develop [js] jQuery, Javascript 모바일(스마트폰) 판단하는 방법 hooni 2015.04.26 2556
215 Develop [js] JSON 컨트롤.. 재귀호출로 값 출력하기 hooni 2013.04.23 28668
214 Develop [js] One Time Pad key generatorㅡ.,ㅡ; file hooni 2013.04.23 6807
213 Develop [js] php의 number_format() 함수와 같은.. ㅋㅋ hooni 2013.04.23 6944
212 Develop [js] selectbox 선택 후 input 박스에 적용 hooni 2013.04.23 8340
211 Develop [js] show/hide 이벤트 감시 (Observing show/hide event) hooni 2021.02.03 2759
210 Develop [js] Text 값을 클립보드에 복사하기 hooni 2020.10.10 783
209 Develop [js] Text 중 URL 형식을 인식해 단축 URL로 변경 file hooni 2013.04.23 8723
208 Develop [js] URL 파싱하기 (jQuery 안쓰고) hooni 2017.12.14 1434
207 Develop [js] window.open() 속성 사용 방법 hooni 2013.11.18 13630
206 Develop [js] 가운데 새창 뜨는 함수와 이벤트 hooni 2003.04.23 6742
Board Pagination Prev 1 ... 48 49 50 51 52 53 54 55 56 57 ... 71 Next
/ 71