Git Product home page Git Product logo

exoplayer-intro's Introduction

Media streaming with ExoPlayer

The code in this repository accompanies the Media streaming with ExoPlayer codelab. If you are looking to get started with ExoPlayer the codelab is a great place to start.

라이브 커머스 공부 시작

HLS는 무엇일까?

애플에서 만든 HTTP 라이브 스트리밍 서비스로 스트림을 작은 단위의 Http 파일형태로 쪼개서 보내준다. 쪼개진 파일들은 2~10초 정도의 트랙으로 끊임없이 전달되며 해상도 등 네트워크 대역폭에 따른 적응형 스트리밍 서비스를 제공해준다. 따라서 클라이언트는 실시간으로 대역폭 혹은 네트워크 상태에 따라 더 좋은 세그먼트로 전환하면 된다.

예) skiing.m3u8, m3u8 확장자로 hls의 마스터 매니페스트 파일이다. 720p, 360p, 480p, 1080p 해상도 마다의 미디어 매니페스트 파일을 가지고 있는 모습

  #EXTM3U

  #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2000000,CODECS="mp4a.40.2, avc1.4d401f"
  skiing-720p.m3u8

  #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=375000,CODECS="mp4a.40.2, avc1.4d4015"
  skiing-360p.m3u8

  #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=750000,CODECS="mp4a.40.2, avc1.4d401e"
  skiing-480p.m3u8

  #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3500000,CODECS="mp4a.40.2, avc1.4d401e"
  skiing-1080p.m3u8

예) skiing-480p, ts 확장자가 2~10초 길이의 하나의 세크먼트

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:9.97667,
file000.ts
#EXTINF:9.97667,
file001.ts
#EXTINF:9.97667,
file002.ts
#EXTINF:9.97667,
file003.ts
#EXTINF:9.97667,
file004.ts

Android에서는 HLS를 어떻게 사용할까?

Apple에서 만든 이유 덕에 iOS 앱에는 별도의 라이브러리 추가할 필요 없이 그냥 사용이 가능하다고 한다. Android에서는 Exoplayer에서 지원해준다.

Exoplayer

  • Android 프레임워크에서 제공해주는 것이 아닌 별도의 라이브러리로 제공줌으로써 버전 제어 가능
  • HLS 같은 적응형 스트리밍 서비스를 제공해준다.
  • MediaPlayer보다 더 좋은 성능, 확장성을 가지고 있다.

단점

  • 단순 음악 플레이어 같은 앱이라면 MediaPlayer보다 배터리 효율이 안나옴
  • APK 파일의 용량 적지않게 증가

참고

  • PIP 모드

exoplayer-intro's People

Contributors

chuchuva avatar dturner avatar jaeryo2357 avatar marcbaechinger avatar nic0lette avatar samthor avatar tunjid avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.