Develop
2015.01.02 19:15
[android] 안드로이드 동영상 스트리밍 예제
Views 4916 Comment 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
No. | Category | Subject | Author | Date | Views |
---|---|---|---|---|---|
793 | Develop | [io] Apple Watch, Today Extension 앱ID 설정 | hooni | 2016.04.20 | 929 |
792 | Develop | [android] 초간단 얼럿 (AlertDialog) | hooni | 2016.10.21 | 932 |
791 | Develop | Aspect Oriented Programming in Objective-C | hooni | 2015.05.18 | 939 |
790 | Develop |
[ios] iOS 앱 아이콘을 만드는 유틸
![]() |
hooni | 2015.01.03 | 939 |
789 | Develop | [android] Android N requires the IDE to be running with Java 1.8 or later 오류 | hooni | 2016.08.30 | 939 |
788 | Develop | [ios] NSString, RegularExpression Find/Replace | hooni | 2017.04.14 | 940 |
787 | Develop | [git] 쉬운 버전관리 Git 설명 | hooni | 2015.08.18 | 952 |
786 | Develop |
[android] N-Puzzle 게임
![]() |
hooni | 2015.07.09 | 953 |
785 | Develop |
[c] 기막힌 정렬 코드 ㅋㄷ
![]() |
hooni | 2015.10.13 | 955 |
784 | Develop |
[c] 이진 탐색 두 가지 코드 (재귀/반복)
![]() |
hooni | 2015.06.26 | 957 |
783 | Develop | [ios] 아이폰 앱 이름 및 버전 정보 | hooni | 2015.03.24 | 958 |
782 | Develop | [ios] UIWebView에서 로컬에 있는 html 파일 불러오기 | hooni | 2015.02.10 | 971 |