Save 37% off PRO during our Black Friday Sale! »

AbemaTVを支えるアプリの優しさ / abematv_devcon_2017

9f4db21673dc0e7cbc313df8310309fb?s=47 Masaki Ogata
October 21, 2017

AbemaTVを支えるアプリの優しさ / abematv_devcon_2017

ネットワーク帯域などの限られたシステムリソースを節約するために、Androidアプリで取り組んでいる優しさをいくつか紹介します。

9f4db21673dc0e7cbc313df8310309fb?s=128

Masaki Ogata

October 21, 2017
Tweet

Transcript

  1. "CFNB57Λࢧ͑Δ ΞϓϦͷ༏͠͞

  2. .BTBLJ0HBUB "OESPJE&OHJOFFS"CFNB57 *OD IUUQTHJUIVCDPNPHBDMFKBQBO !PHBDMFKBQBO

  3. ༏͠͞ͱ͸ʁ

  4. Զࢯɿʮ͍ͨͩ·ʔʯ Շࢯɿʮ͓ؼΓʔɺ͝൧࡞ͬͯ͋ΔΑɻʯ Զࢯɿʢ೥ʹҰ౓ͷح੻ʜʣ༏͠͞ʂʂ 

  5.  lࢥ͍΍Γ͕͋ͬͯ਌੾z  ग़య.BDࣙॻΞϓϦεʔύʔେࣙྛ

  6. ΞϓϦͷ༏͠͞ͱ͸

  7. ωοτϫʔΫ௨৴Λ͍ͩ͡ʹ ΞϓϦͷͤ͘͞ΜGPS6TFS όοςϦʔΛ͔ͭ͏ͳ ΨϯΨϯ͍͜͏ͥ Ξχϝʔγϣϯͤ͞Ζ

  8. 6*ʗ69Λ͍ͩ͡ʹ ΞϓϦͷͤ͘͞ΜGPS4ZTUFN ωοτϫʔΫଳҬΛ࢖͏ͳ Ωϟογϡ͠Α͏ͥ ௿ίετͰӡ༻ͤ͞Ζ

  9.  lωοτϫʔΫ௨৴ྔΛ཈͑Δz  "CFNB57ΞϓϦͷ༏͠͞

  10. "CFNB57Λࢧ͑Δ ΞϓϦͷ༏͠͞  ʙ"OESPJEΞϓϦͷऔΓ૊Έʙ

  11. ͕ɺɺ

  12. ݄๭೔ɻ ⚡࣌ؒੜ์ૹಛ൪ܾఆ⚡

  13. ෛՙରࡦΛਐΊͨ݁Ռɺ

  14. ༏͠͞ʹෆඋ͕͋Γ·ͨ͠

  15. "CFNB57Λࢧ͑Δ ΞϓϦͷ༏͠͞

  16. "CFNB57Λࢧ͑Δ ΞϓϦͷ༏͠͞ XJUI

  17. ϓϨΠϦετऔಘ͠ա͗໰୊

  18. )-4ʢ)551-JWF4USFBNJOHʣ QMBZMJTU@MJWFNV &95.6 &9597&34*0/ &9595"3(&5%63"5*0/ &959.&%*"4&26&/$& &95*/'  UT &95*/'

     UT &95*/'  UT
  19. )-4ʢ)551-JWF4USFBNJOHʣ QMBZMJTU@MJWFNV &95.6 &9597&34*0/ &9595"3(&5%63"5*0/ &959.&%*"4&26&/$& &95*/'  UT &95*/'

     UT &95*/'  UT UT
  20. )-4ʢ)551-JWF4USFBNJOHʣ QMBZMJTU@MJWFNV &95.6 &9597&34*0/ &9595"3(&5%63"5*0/ &959.&%*"4&26&/$& &95*/'  UT &95*/'

     UT &95*/'  UT UT UT
  21. )-4ʢ)551-JWF4USFBNJOHʣ QMBZMJTU@MJWFNV &95.6 &9597&34*0/ &9595"3(&5%63"5*0/ &959.&%*"4&26&/$& &95*/'  UT &95*/'

     UT &95*/'  UT UT UT UT
  22. )-4ʢ)551-JWF4USFBNJOHʣ QMBZMJTU@MJWFNV &95.6 &9597&34*0/ &9595"3(&5%63"5*0/ &959.&%*"4&26&/$& &95*/'  UT &95*/'

     UT &95*/'  UT UT UT UT
  23. )-4ʢ)551-JWF4USFBNJOHʣ QMBZMJTU@MJWFNV &95.6 &9597&34*0/ &9595"3(&5%63"5*0/ &959.&%*"4&26&/$& &95*/'  UT &95*/'

     UT &95*/'  UT UT UT UT UT
  24. )-4"EBQUJWF4USFBNJOH NBTUFS@QMBZMJTUNV &95.6 &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ

    #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV
  25. )-4"EBQUJWF4USFBNJOH NBTUFS@QMBZMJTUNV &95.6 &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ

    #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV NV Q
  26. )-4"EBQUJWF4USFBNJOH NBTUFS@QMBZMJTUNV &95.6 &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ

    #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV NV Q NV Q
  27. ֤σόΠεͷϓϨΠϦετऔಘִؒ ϥΠϒ഑৴Ͱ54ϑΝΠϧͷηάϝϯτִ͕ؒඵͷ৔߹ɻ 1$ 8&# J04 "OESPJE

  28. ֤σόΠεͷϓϨΠϦετऔಘִؒ ϥΠϒ഑৴Ͱ54ϑΝΠϧͷηάϝϯτִ͕ؒඵͷ৔߹ɻ 1$ 8&# J04 "OESPJE ໿ඵִؒ ໿ඵִؒ

  29. ֤σόΠεͷϓϨΠϦετऔಘִؒ ϥΠϒ഑৴Ͱ54ϑΝΠϧͷηάϝϯτִ͕ؒඵͷ৔߹ɻ 1$ 8&# J04 "OESPJE ໿ඵִؒ ໿ඵִؒ ໿ ඵִؒ

  30.  ŧŖƃ

  31. ݁࿦ɺ&YP1MBZFSͷෆ۩߹Ͱͨ͠ɻɻ IUUQTHJUIVCDPNHPPHMF &YP1MBZFSQVMM

  32. ߴϏοτϨʔτ΁੾ΓସΘΓޙ΋Q͕औಘ͞Εଓ͚͍ͯͨ NBTUFS@QMBZMJTUNV &95.6 &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ

    #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV NV Q NV Q
  33. ͜ΕͰ໰୊ղফ

  34. ը໘ʹ࠷దͳϏοτϨʔτ੍ޚ

  35. "CFNB57։ہ౰ॳ೥݄ ΞϓϦ͸ԣը໘ݻఆͰࢹௌ໘ͷը໘αΠζ΋ύλʔϯͷΈɻ

  36. "CFNB57։ہप೥೥݄ ΞϓϦ͸ैདྷͷԣը໘ʹՃ͑ɺॎը໘Ͱͷࢹௌʹ΋ରԠɻ

  37. "CFNB57։ہप೥೥݄ ͞Βʹɺ"OESPJE৽ػೳͷϚϧν΢Οϯυ΢Ͱ΋ࢹௌՄೳʹɻ

  38. ࢹௌ໘ͷύλʔϯ͕ෳࡶԽʜ

  39. )-4"EBQUJWF4USFBNJOH NBTUFS@QMBZMJTUNV &95.6 &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ

    #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV NV Q NV Q
  40. )-4"EBQUJWF4USFBNJOH NBTUFS@QMBZMJTUNV &95.6 &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ

    #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV NV Q NV Q Q 'VMM)% Y
  41. )-4"EBQUJWF4USFBNJOH NBTUFS@QMBZMJTUNV &95.6 &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ

    #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV NV Q NV Q Y Q 'VMM)% Y
  42. )-4"EBQUJWF4USFBNJOH NBTUFS@QMBZMJTUNV &95.6 &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ

    #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV NV Q NV Q Y Q 'VMM)% Y , ໿ഒͷ௨৴ྔʜ
  43. )-4"EBQUJWF4USFBNJOH NBTUFS@QMBZMJTUNV &95.6 &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ

    #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV &959ʜ #"/%8*%5) QMBZMJTU@MJWFNV NV Q NV Q Y Q 'VMM)% Y Q )% Y
  44. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ ͍͔ͭ͘ͷ৚݅Λ૊Έ߹ΘͤͯϏοτϨʔτΛಈతʹมߋ͍ͯ͠Δɻ ը࣭ઃఆ ௨৴ճઢ ը໘෯ ࣗಈ ࠷ߴը࣭ ߴը࣭ ʜ 8*'*

    .PCJMF ʜ 8JOEPX෯ 7JFX෯ ʜ 04WFS YPSIJHIFS Y ʜ
  45. public class VideoBitrateAdjuster { private final VideoBitrateTable auto = new

    AutoBitrateTable(); private final VideoBitrateTable legacy = new LegacyBitrateTable(); private final VideoBitrateTable manual = new ManualBitrateTable(); public VideoBitrate adjust(@Px int w, VideoQuality quality, NetworkState network) { if (quality == AUTO) { if (isLegacyPlatform()) { return legacy.lookup(w, quality, network); } else { return auto.lookup(w, quality, network); } } else { return manual.lookup(w, quality, network); } } "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ ˞αϯϓϧίʔυͰ͢
  46. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ public class LimitedBandwidthMeter implements BandwidthMeter { ... public setMaxBitrate(long

    bitrate) { ... } public long getBitrateEstimate() { return Math.min(bitrateEstimate, maxBitrate); } ... } package com.google.android.exoplayer2.upstream; public interface BandwidthMeter { long getBitrateEstimate(); } ˞αϯϓϧίʔυͰ͢
  47. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer NV UT

  48. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 8*'* QY NV UT

  49. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 8*'* QY NV UT

  50. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 8*'* QY Q NV

    UT
  51. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 8*'* QY Q CQT

    NV UT
  52. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 8*'* QY Q CQT

    NBY#JUSBUFQ NV UT
  53. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 8*'* QY Q CQT

    NBY#JUSBUFQ NV UT
  54. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 8*'* QY Q CQT

    NBY#JUSBUFQ NV UT
  55. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 8*'* QY Q CQT

    NBY#JUSBUFQ NV UT Q
  56. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 8*'* QY Q CQT

    NBY#JUSBUFQ NV UT Q Q
  57. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 .0#*-& QY Q CQT

    NBY#JUSBUFQ NV UT Q Q
  58. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 .0#*-& QY Q CQT

    NBY#JUSBUFQ NV UT Q Q
  59. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 .0#*-& QY Q CQT

    NBY#JUSBUFQ NV UT Q Q
  60. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 .0#*-& QY Q CQT

    NBY#JUSBUFQ NV UT Q Q
  61. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 .0#*-& QY Q CQT

    NBY#JUSBUFQ NV UT Q Q
  62. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 .0#*-& QY Q CQT

    NBY#JUSBUFQ NV UT Q Q
  63. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 .0#*-& QY Q CQT

    NBY#JUSBUFQ NV UT Q Q
  64. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 .0#*-& QY Q CQT

    NBY#JUSBUFQ NV UT Q Q
  65. "CFNB57ΞϓϦͷϏοτϨʔτ੍ޚʢ"OESPJEʣ VideoBitrateAdjuster PlayerBitrateChanger LimitedBandwidthMeter ExoPlayer "650 .0#*-& QY Q CQT

    NBY#JUSBUFQ NV UT Q Q
  66. ͢΂ͯ͸௨৴ྔΛ཈͑ΔͨΊ

  67. ·ͱΊ

  68. ·ͱΊ wϓϨΠϦετऔಘ͠ա͗໰୊ ࠷৽ͷ&YP1MBZFSʢSʣΛར༻͢Ε͹ղফͰ͖Δɻ wը໘ʹ࠷దͳϏοτϨʔτ੍ޚ ଳҬ্ݶΛઃఆ͢Δ͜ͱͰແବͳ௨৴ྔΛ཈͑Δ͜ͱ͕Ͱ͖Δɻ

  69. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ

  70. 8F`SFIJSJOH IUUQTBCFNBHO[SBT