Contents

Views 4910 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] 사진첩에 쓸 내용 - 마우스 오버로 바꾸기 hooni 2013.04.23 6356
216 Develop [c][php] 프로세스정보와 메모리 정보 웹으로 출력하는거.. file hooni 2013.04.23 6337
215 Develop [java] 에디터.. swing 사용 file hooni 2013.04.23 6326
214 Develop [js] 서서히 나타나는 화면.. ㅋㅋ hooni 2013.04.23 6218
213 Develop [doc] C++언어 문법 설명서 file hooni 2013.04.23 6188
212 Develop [js] 자바스크립트 escape()를 PHP로 받기 hooni 2013.04.23 6001
211 Develop [c] 윈도우 API Viewport와 Window file hooni 2013.04.23 5975
210 Develop [ios] Using protobuf(Protocol Buffers) on iPhone (iOS) file hooni 2014.03.20 5008
209 Develop [PHP] MacOS에서 PHP 7 설치하기 file hooni 2018.05.11 4994
» Develop [android] 안드로이드 동영상 스트리밍 예제 2 hooni 2015.01.02 4910
207 Develop [ios] UITableView 특정 Row만 Update hooni 2014.04.08 4836
206 Develop [ios] UUID 생성 + Key Chain 연동 file hooni 2016.05.13 4769
Board Pagination Prev 1 ... 48 49 50 51 52 53 54 55 56 57 ... 71 Next
/ 71