Browse Source

switched to local exoplayer using branch dev-v2

yattoz 4 years ago
parent
commit
36a3e9046d

+ 3 - 0
.gitmodules View File

1
+[submodule "ExoPlayer"]
2
+	path = ExoPlayer
3
+	url = https://github.com/google/ExoPlayer/

+ 22 - 0
.idea/gradle.xml View File

8
         <option name="modules">
8
         <option name="modules">
9
           <set>
9
           <set>
10
             <option value="$PROJECT_DIR$" />
10
             <option value="$PROJECT_DIR$" />
11
+            <option value="$PROJECT_DIR$/ExoPlayer/extensions/av1" />
12
+            <option value="$PROJECT_DIR$/ExoPlayer/extensions/cast" />
13
+            <option value="$PROJECT_DIR$/ExoPlayer/extensions/cronet" />
14
+            <option value="$PROJECT_DIR$/ExoPlayer/extensions/ffmpeg" />
15
+            <option value="$PROJECT_DIR$/ExoPlayer/extensions/flac" />
16
+            <option value="$PROJECT_DIR$/ExoPlayer/extensions/gvr" />
17
+            <option value="$PROJECT_DIR$/ExoPlayer/extensions/ima" />
18
+            <option value="$PROJECT_DIR$/ExoPlayer/extensions/jobdispatcher" />
19
+            <option value="$PROJECT_DIR$/ExoPlayer/extensions/leanback" />
20
+            <option value="$PROJECT_DIR$/ExoPlayer/extensions/mediasession" />
21
+            <option value="$PROJECT_DIR$/ExoPlayer/extensions/okhttp" />
22
+            <option value="$PROJECT_DIR$/ExoPlayer/extensions/opus" />
23
+            <option value="$PROJECT_DIR$/ExoPlayer/extensions/rtmp" />
24
+            <option value="$PROJECT_DIR$/ExoPlayer/extensions/vp9" />
25
+            <option value="$PROJECT_DIR$/ExoPlayer/extensions/workmanager" />
26
+            <option value="$PROJECT_DIR$/ExoPlayer/library/all" />
27
+            <option value="$PROJECT_DIR$/ExoPlayer/library/core" />
28
+            <option value="$PROJECT_DIR$/ExoPlayer/library/dash" />
29
+            <option value="$PROJECT_DIR$/ExoPlayer/library/hls" />
30
+            <option value="$PROJECT_DIR$/ExoPlayer/library/smoothstreaming" />
31
+            <option value="$PROJECT_DIR$/ExoPlayer/library/ui" />
32
+            <option value="$PROJECT_DIR$/ExoPlayer/testutils" />
11
             <option value="$PROJECT_DIR$/app" />
33
             <option value="$PROJECT_DIR$/app" />
12
           </set>
34
           </set>
13
         </option>
35
         </option>

+ 1 - 0
.idea/vcs.xml View File

2
 <project version="4">
2
 <project version="4">
3
   <component name="VcsDirectoryMappings">
3
   <component name="VcsDirectoryMappings">
4
     <mapping directory="" vcs="Git" />
4
     <mapping directory="" vcs="Git" />
5
+    <mapping directory="$PROJECT_DIR$/ExoPlayer" vcs="Git" />
5
   </component>
6
   </component>
6
 </project>
7
 </project>

+ 1 - 0
ExoPlayer

1
+Subproject commit 24a19264dbf35e326bbd7bb36c232eb180e1e26d

+ 3 - 1
app/build.gradle View File

65
      */
65
      */
66
 
66
 
67
     implementation "androidx.media:media:1.1.0"
67
     implementation "androidx.media:media:1.1.0"
68
-    implementation 'com.google.android.exoplayer:exoplayer:2.11.0'
68
+    //implementation 'com.google.android.exoplayer:exoplayer:2.11.1'
69
+    implementation project(':exoplayer-library') // uses local ExoPlayer clone, from dev-v2 branch (fixes ISO-8859-1 ICY metadata
70
+
69
     implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
71
     implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
70
     implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0'
72
     implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0'
71
 
73
 

BIN
app/debug/app-debug.apk View File


+ 1 - 0
app/debug/output.json View File

1
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":2,"versionName":"1.1dev","enabled":true,"outputFile":"app-debug.apk","fullName":"debug","baseName":"debug"},"path":"app-debug.apk","properties":{}}]

BIN
app/release/app-release.apk View File


+ 1 - 0
app/release/output.json View File

1
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":2,"versionName":"1.1dev","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]

+ 5 - 0
app/src/main/java/fr/forum_thalie/tsumugi/RadioService.kt View File

32
 import androidx.preference.PreferenceManager
32
 import androidx.preference.PreferenceManager
33
 import com.google.android.exoplayer2.*
33
 import com.google.android.exoplayer2.*
34
 import com.google.android.exoplayer2.metadata.icy.*
34
 import com.google.android.exoplayer2.metadata.icy.*
35
+import com.google.android.exoplayer2.trackselection.DefaultTrackSelector
35
 import fr.forum_thalie.tsumugi.alarm.RadioAlarm
36
 import fr.forum_thalie.tsumugi.alarm.RadioAlarm
36
 import fr.forum_thalie.tsumugi.alarm.RadioSleeper
37
 import fr.forum_thalie.tsumugi.alarm.RadioSleeper
37
 import fr.forum_thalie.tsumugi.planning.Planning
38
 import fr.forum_thalie.tsumugi.planning.Planning
350
             setBufferDurationsMs(minBufferMillis, maxBufferMillis, bufferForPlayback, bufferForPlaybackAfterRebuffer)
351
             setBufferDurationsMs(minBufferMillis, maxBufferMillis, bufferForPlayback, bufferForPlaybackAfterRebuffer)
351
         }.createDefaultLoadControl()
352
         }.createDefaultLoadControl()
352
 
353
 
354
+        /*
353
         val playerBuilder = SimpleExoPlayer.Builder(this)
355
         val playerBuilder = SimpleExoPlayer.Builder(this)
354
         playerBuilder.setLoadControl(loadControl)
356
         playerBuilder.setLoadControl(loadControl)
355
         player = playerBuilder.build()
357
         player = playerBuilder.build()
358
+        */
359
+
360
+        player = ExoPlayerFactory.newSimpleInstance(this, DefaultTrackSelector(), loadControl)
356
 
361
 
357
         player.addMetadataOutput {
362
         player.addMetadataOutput {
358
             for (i in 0 until it.length()) {
363
             for (i in 0 until it.length()) {

+ 1 - 1
app/src/main/java/fr/forum_thalie/tsumugi/ui/news/NewsAdapter.kt View File

134
             HtmlCompat.FROM_HTML_MODE_LEGACY,
134
             HtmlCompat.FROM_HTML_MODE_LEGACY,
135
             ImageGetter { source ->
135
             ImageGetter { source ->
136
                 val d = LevelListDrawable()
136
                 val d = LevelListDrawable()
137
-                val empty: Drawable? = ContextCompat.getDrawable(c, R.drawable.exo_icon_circular_play)
137
+                val empty: Drawable? = ContextCompat.getDrawable(c, R.drawable.exo_icon_play)
138
 
138
 
139
                 d.addLevel(0, 0, empty!!)
139
                 d.addLevel(0, 0, empty!!)
140
                 d.setBounds(0, 0, empty.intrinsicWidth, empty.intrinsicHeight)
140
                 d.setBounds(0, 0, empty.intrinsicWidth, empty.intrinsicHeight)

+ 4 - 0
settings.gradle View File

1
 include ':app'
1
 include ':app'
2
 rootProject.name='Tsumugi-app'
2
 rootProject.name='Tsumugi-app'
3
+
4
+gradle.ext.exoplayerRoot = './ExoPlayer'
5
+gradle.ext.exoplayerModulePrefix = 'exoplayer-'
6
+apply from: new File(gradle.ext.exoplayerRoot, 'core_settings.gradle')