Develop
2015.01.02 19:15
[android] 안드로이드 동영상 스트리밍 예제
조회 수 4924 댓글 2
소스(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
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
261 | Database | [mysql] 접속과 테이블 생성 간단한 설명.. | hooni | 2003.04.23 | 18743 |
260 | Database | [mysql] 중복데이터 삭제하는 초간단 쿼리 | hooni | 2017.11.22 | 3557 |
259 | Database | [mysql] 쿼리 로그 저장 매뉴얼 | hooni | 2013.04.23 | 15366 |
258 | Database | [mysql] 쿼리 실행시 ERROR 1366 (HY000) : incorrect string value : for column 3 | hooni | 2017.03.30 | 8964 |
257 | PPT | [network] tcp/ip 설명 html파일 9장(ppt 포함) | hooni | 2013.04.23 | 11691 |
256 | Etc | [NFC] 단말기와 서버 통신 내용 | hooni | 2013.11.12 | 11235 |
255 | Develop | [node.js] nodejs 기본 설치 | hooni | 2013.04.23 | 26325 |
254 | Develop | [node.js] 지금 하고 있는거.. | hooni | 2013.04.23 | 27025 |
253 | Develop | [opengl] 컴퓨터 그래픽스 강의 자료(수업자료) | hooni | 2003.04.23 | 20524 |
252 | Database | [oracle] Oracle 사용자 추가 절차 | hooni | 2019.11.22 | 760 |
251 | Database | [oracle] SQL문 실행 방법 3가지 | hooni | 2013.12.19 | 12192 |
250 | System/OS | [owasp] 10대 웹어플리케이션 보안 취약 | hooni | 2013.04.23 | 15999 |