Skip to content

Media3 service analysis #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 70 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
c031381
wip
lstonussi May 9, 2024
994244e
chore: adjust commands
atrope May 9, 2024
f18fb49
media3 with notification and favorite
lstonussi May 21, 2024
521a4b4
wip
lstonussi May 29, 2024
1aa9dbb
change branch
lstonussi Aug 4, 2024
9df68fc
trying with MediaLibraryService.MediaLibrarySession
lstonussi Aug 17, 2024
24eeb7a
custom button working
lstonussi Aug 19, 2024
e98da71
fix notification in sdk33 below
lstonussi Aug 19, 2024
fa48cf2
remove unnecessary code
lstonussi Aug 22, 2024
e861af7
fix deprecated
lstonussi Aug 22, 2024
c3a0b5b
remove unused class
lstonussi Aug 22, 2024
968c43c
remove comments and fix release
lstonussi Aug 22, 2024
35491ba
fix remove notification
lstonussi Aug 26, 2024
e3c7c87
remove unused code
lstonussi Aug 26, 2024
5caea20
Merge branch 'master' into media3_v2
lstonussi Aug 26, 2024
2fbc084
wip
lstonussi Aug 28, 2024
f069104
wip
lstonussi Aug 30, 2024
fac7d75
wip
lstonussi Aug 30, 2024
0ae65c4
chore: cursor find my bug
atrope Aug 30, 2024
cb34a6d
supersonic enqueue
lstonussi Sep 2, 2024
66f2535
remove sendNotification
lstonussi Sep 2, 2024
28338dd
remove ununsed methods
lstonussi Sep 2, 2024
5e1a8ef
remove comment
lstonussi Sep 2, 2024
d90a1b2
fix shuffle, reorder and remove
lstonussi Sep 5, 2024
05b8d0b
daily
lstonussi Sep 6, 2024
a50f177
chore: daily
atrope Sep 6, 2024
5505e37
favorite and isar ok
lstonussi Sep 9, 2024
e841979
fix isar and shuffle
lstonussi Sep 10, 2024
663c911
fix enqueue
lstonussi Sep 10, 2024
3089c71
enqueue batch
lstonussi Sep 10, 2024
7bb2ebc
working before queue process
lstonussi Sep 11, 2024
1c2f538
added queue process
lstonussi Sep 11, 2024
f7fa7ed
fix auto play
lstonussi Sep 11, 2024
28bae18
added localMediaValidator
lstonussi Sep 12, 2024
f504ab4
fix favorite and remove unused code
lstonussi Sep 12, 2024
9636695
restore isar playlist
lstonussi Sep 13, 2024
004d696
fix isar, int overflow, stopself when task removed
lstonussi Sep 13, 2024
f7021a4
fix remove in and playfromqueue
Sep 17, 2024
aa5c713
added set repeat mode and update mediaItem with fallback
Sep 18, 2024
065c5b4
revert commit
Sep 18, 2024
375b526
fix update queue
Sep 18, 2024
35f1c9b
fix isar
Sep 19, 2024
183b865
set repeat mode all in playfrom queue
Sep 19, 2024
dcb7a89
added brackets
Sep 20, 2024
c357bcb
init covertion to avqueueplayer
Sep 23, 2024
577b51d
playing and notifying
Sep 26, 2024
fcd81c6
now playing ok
Sep 27, 2024
5f41c7e
new queue
Sep 30, 2024
a400f50
enqueue, playfromqueue, next and previous ok
Oct 2, 2024
291a4e8
fix reorder and shuffle
Oct 7, 2024
70662c2
fix observers
Oct 10, 2024
ced17b5
improve example and fix isar
Oct 10, 2024
c201a85
added remove_in ios
Oct 15, 2024
8a392ba
fix init isar
Nov 8, 2024
0ac0bad
fix androido transition
Dec 6, 2024
c1714f4
modifying gitignore
Dec 6, 2024
9e8c316
fix transition
Dec 9, 2024
109ad7a
notify when change in notification
Dec 9, 2024
ba93d73
fix transition
Dec 10, 2024
569bc44
remove comment
Dec 11, 2024
26768bc
fix transition and repeat mode
Dec 13, 2024
4fb16c7
fix when playfromQueue
Dec 13, 2024
0f471b2
added cookie from all batches
Dec 13, 2024
8fab549
before cast test
Dec 17, 2024
b3cb523
disable notification when has ads
Dec 17, 2024
df5a115
fix lastPrevious
Dec 17, 2024
b18e5fb
enable commandCenter buttons
Dec 18, 2024
86349e4
remove notification when clear queue
Dec 18, 2024
ea6b4db
added nullable
Dec 18, 2024
3170071
update function name
Dec 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/player/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

build/


example/linux/
example/macos/
example/windows/
# Created by https://www.gitignore.io/api/dart,android,flutter,jetbrains,visualstudio,androidstudio,visualstudiocode
# Edit at https://www.gitignore.io/?templates=dart,android,flutter,jetbrains,visualstudio,androidstudio,visualstudiocode

Expand Down
22 changes: 13 additions & 9 deletions packages/player/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ version '1.0.4'

buildscript {
ext.kotlin_version = '1.9.20'
ext.exoplayer_version = '2.19.1'
ext.media3_version = '1.4.1'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.android.tools.build:gradle:8.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down Expand Up @@ -44,20 +44,24 @@ android {
lintOptions {
disable 'InvalidPackage'
}

namespace = "br.com.suamusica.player"
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
implementation "com.google.android.exoplayer:exoplayer:$exoplayer_version"
implementation "com.google.android.exoplayer:extension-mediasession:$exoplayer_version"
implementation "androidx.media:media:1.7.0"
implementation "org.jetbrains.kotlin:kotlin-reflect"
//MEDIA3 DEPENDENCIES
implementation "androidx.media3:media3-exoplayer:$media3_version"
implementation "androidx.media3:media3-exoplayer-hls:$media3_version"
implementation "androidx.media3:media3-session:$media3_version"
implementation "androidx.media3:media3-common:$media3_version"
implementation "androidx.media3:media3-ui:$media3_version"

// implementation files('/Users/lucastonussi/flutter/bin/cache/artifacts/engine/android-x64/flutter.jar')
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2'

// Glide dependencies
implementation "com.github.bumptech.glide:glide:4.12.0"
// implementation files('/Users/alantrope/flutter/bin/cache/artifacts/engine/android-x64/flutter.jar')
kapt "com.github.bumptech.glide:compiler:4.12.0"
implementation "com.google.code.gson:gson:2.10.1"

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
15 changes: 6 additions & 9 deletions packages/player/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="br.com.suamusica.player">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />

<application>
<service android:name=".MediaService" android:exported="false" android:foregroundServiceType="mediaPlayback">
<intent-filter>
<action android:name="androidx.media3.session.MediaSessionService"/>
<action android:name="android.intent.action.MEDIA_BUTTON" />
<action android:name="android.media.browse.MediaBrowserService" />
</intent-filter>
</service>

<receiver android:name=".MediaControlBroadcastReceiver" android:exported="false">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</receiver>
</application>
</manifest>
</manifest>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
package br.com.suamusica.player

class Media(
val name: String,
val author: String,
val url: String,
val coverUrl: String,
val bigCoverUrl: String?,
val isFavorite: Boolean?
import com.google.gson.annotations.SerializedName

data class Media(
@SerializedName("id") val id: Long,
@SerializedName("name") val name: String,
@SerializedName("ownerId") val ownerId: Int,
@SerializedName("albumId") val albumId: Long,
@SerializedName("albumTitle") val albumTitle: String,
@SerializedName("author") val author: String,
@SerializedName("url") val url: String,
@SerializedName("is_local") val isLocal: Boolean,
@SerializedName("cover_url") val coverUrl: String,
@SerializedName("bigCover") val bigCoverUrl: String,
@SerializedName("is_verified") val isVerified: Boolean,
@SerializedName("shared_url") val shareUrl: String,
@SerializedName("playlist_id") val playlistId: Long,
@SerializedName("is_spot") val isSpot: Boolean,
@SerializedName("isFavorite") val isFavorite: Boolean?,
@SerializedName("fallbackUrl") val fallbackUrl: String,
@SerializedName("indexInPlaylist") val indexInPlaylist: Int?,
@SerializedName("catid") val categoryId: Int,
@SerializedName("playlistTitle") val playlistTitle: String,
@SerializedName("playlistCoverUrl") val playlistCoverUrl: String,
@SerializedName("playlistOwnerId") val playlistOwnerId: Int
)
Loading