Contents

조회 수 4823 댓글 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


?

  1. [c] 단기과정[01/14] 피보나치, 파스칼.. 파일입출력

  2. [c] 단기과정[01/14] 파일 입출력

  3. [c] 단기과정[01/10] 과제.. swap(any data, ..)

  4. [c] 단기과정[01/08] 배열, 포인터

  5. [c] 단기과정[01/08] 과제.. 파스칼 삼각형

  6. [c] 단기과정[01/08] (다차원 + 배열)포인터, void 포인터

  7. [c] 단기과정[01/07] 제어문, 피보나치수열

  8. [c] 단기과정[01/06] sizeof, 실수표현, 메모리, 연산자

  9. [c] 다중연결 서버 만들기 #4 - thread 사용

  10. [c] 다중연결 서버 만들기 #3 - poll() 사용

  11. [c] 다중연결 서버 만들기 #2 - select() 사용

  12. [c] 다중연결 서버 만들기 #1 - fork() 사용

Board Pagination Prev 1 ... 45 46 47 48 49 50 51 52 53 54 ... 71 Next
/ 71