Contents

Views 4928 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


?

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

  2. [js] 키보드 아스키 코드 확인하는 간단한 소스

  3. [c#] HTML 이벤트 샘플 소스..

  4. [api] 인스타그램 API Access_Token 발급 방법 (Instagram API)

  5. [c#]뉴 툴바 개인적으로 만든거.. (new)

  6. [ios] How To Use UIScrollView to Scroll and Zoom Content (Using Swift)

  7. [doc] mfc 매뉴얼 다운 받아서 완성하기.. ㅋㄷ

  8. [c] 코드 최적화에 대해..

  9. [c] 프로그래밍의 전반적인 설명 ppt

  10. [c] 프로그램 코드(c/c++)를 html 파일로 변환

  11. [c] 구조체 배열 예제 (학생 성적 계산)

  12. [c] 관계형 연산자에 대한 설명

Board Pagination Prev 1 ... 50 51 52 53 54 55 56 57 58 59 ... 98 Next
/ 98