출처: http://yhcting.tistory.com/m/post/309
Sometimes developer may need to use MediaPlayer directly instead of using VideoView.
In this case, developer should keep belows in his/her mind.
<NOTE : Gingerbread and ICS are a little different (ICS is more flexible. But, the more strict is the better.)>
- setDisplay Should be called after surface of SurfaceHolder is created.
- video should be started after it's video size is known (after onVideoSizeChanged is called.)
- setDisplay() should be called before prepare()
Let's summarize it.
onSurfaceCreate -> setDisplay() -> prepare()/prepareAsync()
: onVideoSizechanged
: onPrepared
→ Now, MediaPlayer is fully prepared to be started.
'IT_Programming > Android_Java' 카테고리의 다른 글
[펌] 모바일웹 반응형 무한스크롤 개발 및 성능 튜닝 (0) | 2014.08.25 |
---|---|
[펌] 웹뷰 기반의 하이브리드 앱 개발 노하우 (0) | 2014.08.25 |
ListView Header에 Viewpager 추가 (0) | 2014.08.11 |
Android Debug Vs Release Build Check in Running Code (0) | 2014.08.08 |
[Android] activity-alias 태그를 사용하는 좋은 예. (0) | 2014.08.06 |