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
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
1113 | System/OS | How to Setup an Email Server on CentOS 7 | hooni | 2018.04.05 | 3036 |
1112 | Develop | How to Test SMTP AUTH using Telnet | hooni | 2018.04.05 | 1591 |
1111 | Develop |
[python] DJI Tello 드론 코딩 (프로그래밍)
58 ![]() |
hooni | 2018.03.04 | 28271 |
1110 | System/OS |
[mac] 맥에서 기본 실행 앱 변경하기
![]() |
hooni | 2018.03.02 | 1970 |
1109 | System/OS | 콘솔에서 패스워드 걸린 zip 압축하는 명령 | hooni | 2018.03.02 | 1137 |
1108 | Develop | What is difference between Get, Post, Put and Delete? | hooni | 2018.02.28 | 1573 |
1107 | Develop | [php] Laravel Route에서 PC/Mobile 분기 | hooni | 2018.01.24 | 2675 |
1106 | Develop | Laravel 5 Failed opening required bootstrap/../vendor/autoload.php | hooni | 2018.01.24 | 1838 |
1105 | Develop |
[php][laravel] 라라벨 개발환경 세팅하기 (Mac, Window)
2 ![]() |
hooni | 2017.12.15 | 2780 |
1104 | Develop |
[php][laravel] 라라벨 프로젝트 생성 및 구조
![]() |
hooni | 2017.12.15 | 2559 |
1103 | Develop | [php][laravel] 초간단 MacOS에서 Laravel 개발 환경 구축 | hooni | 2017.12.15 | 2123 |
1102 | Database |
[mysql] MacOS에 MySQL 설치, 설정, 암호 재설정
![]() |
hooni | 2017.12.15 | 1625 |