init-android-exo.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #! /usr/bin/env bash
  2. #
  3. # Copyright (C) 2013-2015 Bilibili
  4. # Copyright (C) 2013-2015 Zhang Rui <bbcallen@gmail.com>
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. IJK_EXO_UPSTREAM=https://github.com/google/ExoPlayer.git
  19. IJK_EXO_FORK=https://github.com/google/ExoPlayer.git
  20. IJK_EXO_COMMIT=r1.5.11
  21. IJK_EXO_LOCAL_REPO=extra/ExoPlayer
  22. set -e
  23. TOOLS=tools
  24. echo "== pull ExoPlayer base =="
  25. sh $TOOLS/pull-repo-base.sh $IJK_EXO_UPSTREAM $IJK_EXO_LOCAL_REPO
  26. echo "== pull ExoPlayer fork =="
  27. cd extra/ExoPlayer
  28. git checkout ${IJK_EXO_COMMIT} -B ijkplayer
  29. cd -
  30. SRC_EXO_DIR=extra/ExoPlayer/demo/src/main/java/com/google/android/exoplayer/demo
  31. DST_EXO_DIR=android/ijkplayer/ijkplayer-exo/src/main/java/tv/danmaku/ijk/media/exo/demo
  32. mkdir -p $DST_EXO_DIR/player
  33. function install_java()
  34. {
  35. JAVA_FILE=$1
  36. cat $SRC_EXO_DIR/$JAVA_FILE \
  37. | sed "s/^package com.google.android.exoplayer.demo/package tv.danmaku.ijk.media.exo.demo/g" \
  38. | sed "s/^import com.google.android.exoplayer.demo/import tv.danmaku.ijk.media.exo.demo/g" \
  39. | sed "s/@link/link/g" \
  40. > $DST_EXO_DIR/$JAVA_FILE
  41. }
  42. install_java player/DashRendererBuilder.java
  43. install_java player/DemoPlayer.java
  44. install_java player/ExtractorRendererBuilder.java
  45. install_java player/HlsRendererBuilder.java
  46. install_java player/SmoothStreamingRendererBuilder.java
  47. install_java EventLogger.java
  48. install_java SmoothStreamingTestMediaDrmCallback.java
  49. # install_java WidevineTestMediaDrmCallback.java