Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

ExoPlayerで最適な視聴体験を届けるために / AbemaTV DevCon 2018 TrackB Session B4

2,498 views

Published on

視聴体験向上のために行っているExoPlayer関連のTipsについてお話します。

Published in: Technology
  • Be the first to comment

ExoPlayerで最適な視聴体験を届けるために / AbemaTV DevCon 2018 TrackB Session B4

  1. 1. #EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=300000 http://mycompany.com/240p.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1400000 http://mycompany.com/480p.m3u8 … … #EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=2400000 http://mycompany.com/720p.m3u8 … …
  2. 2. #EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=300000 http://mycompany.com/240p.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1400000 http://mycompany.com/480p.m3u8 … … #EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=2400000 http://mycompany.com/720p.m3u8 … …
  3. 3. #EXT-X-VERSION:3 #EXTM3U #EXT-X-TARGETDURATION:10 #EXT-X-MEDIA-SEQUENCE:1 #EXTINF:10.0, http://media.example.com/segment1.ts #EXTINF:9.0, http://media.example.com/segment2.ts …
  4. 4. #EXT-X-VERSION:3 #EXTM3U #EXT-X-TARGETDURATION:10 #EXT-X-MEDIA-SEQUENCE:1 #EXTINF:10.0, http://media.example.com/segment1.ts #EXTINF:9.0, http://media.example.com/segment2.ts …
  5. 5.
  6. 6. public interface BandwidthMeter { … /** Returns the estimated bandwidth in bits/sec. */ long getBitrateEstimate(); … }
  7. 7. class AbemaBandwidthMeter( private val default: DefaultBandwidthMeter ) : BandwidthMeter by default, TransferListener<Any> by default { private var limitBitrate = Long.MAX_VALUE override fun getBitrateEstimate(): Long { return Math.min(default.bitrateEstimate, limitBitrate) } fun setLimitBitrate(limitBitrate: Long) { this.limitBitrate = limitBitrate } }
  8. 8. class AbemaBandwidthMeter( private val default: DefaultBandwidthMeter ) : BandwidthMeter by default, TransferListener<Any> by default { private var limitBitrate = Long.MAX_VALUE override fun getBitrateEstimate(): Long { return Math.min(default.bitrateEstimate, limitBitrate) } fun setLimitBitrate(limitBitrate: Long) { this.limitBitrate = limitBitrate } } override fun getBitrateEstimate(): Long { return Math.min(default.bitrateEstimate, limitBitrate) }
  9. 9. private fun stopVideo() { … sendPlayerLog(); } private fun sendPlayerLog() { // send log here } private fun pauseVideo() { … sendPlayerLog(); } private val programMetaChanged = { meta -> if (shouldSend) sendPlayerLog() };
  10. 10. private fun stopVideo() { … sendPlayerLog(); } private fun sendPlayerLog() { // send log here }} private fun pauseVideo() { … sendPlayerLog(); } private val programMetaChanged = { meta -> if (shouldSend) sendPlayerLog() }; ✘ ✘
  11. 11. private fun sendPlayerLog() { // send log here }} @Override public void onCreate(Bundle b) { super.onCreate(b); … val logTracker = PlayerLogTracker(…) player.addTrackers( logTracker, … ) } class PlayerLogTracker( metadataDetector: MetadataDetector, stateDetector: PlaybackStateDetector, sendPlayerLog: () -> Unit ) { // call sendPlayerLog() }
  12. 12. private fun sendPlayerLog() { // send log here } @Override public void onCreate(Bundle b) { super.onCreate(b); … val logTracker = PlayerLogTracker(…) player.addTrackers( logTracker, … ) } class PlayerLogTracker( metadataDetector: MetadataDetector, stateDetector: PlaybackStateDetector, sendPlayerLog: () -> Unit ) { // call sendPlayerLog() } ✔ ✔ ✔
  13. 13. ✔ ✔ ✔

×