Regenerated Pigeon code

This commit is contained in:
Angelo Cassano 2023-03-28 13:18:35 +02:00
parent 3861a0f144
commit 1a5dbbbed6
27 changed files with 2528 additions and 1797 deletions

View file

@ -27,13 +27,13 @@ fun getFlutterAdBreakStatus(adBreakStatus: AdBreakStatus?): PlatformBridgeApis.A
fun getFlutterPlayerState(playerStateRaw: Int?): PlatformBridgeApis.PlayerState {
return when (playerStateRaw) {
MediaStatus.PLAYER_STATE_UNKNOWN -> PlatformBridgeApis.PlayerState.unknown
MediaStatus.PLAYER_STATE_BUFFERING -> PlatformBridgeApis.PlayerState.buffering
MediaStatus.PLAYER_STATE_IDLE -> PlatformBridgeApis.PlayerState.idle
MediaStatus.PLAYER_STATE_LOADING -> PlatformBridgeApis.PlayerState.loading
MediaStatus.PLAYER_STATE_PAUSED -> PlatformBridgeApis.PlayerState.paused
MediaStatus.PLAYER_STATE_PLAYING -> PlatformBridgeApis.PlayerState.playing
else -> PlatformBridgeApis.PlayerState.unknown
MediaStatus.PLAYER_STATE_UNKNOWN -> PlatformBridgeApis.PlayerState.UNKNOWN
MediaStatus.PLAYER_STATE_BUFFERING -> PlatformBridgeApis.PlayerState.BUFFERING
MediaStatus.PLAYER_STATE_IDLE -> PlatformBridgeApis.PlayerState.IDLE
MediaStatus.PLAYER_STATE_LOADING -> PlatformBridgeApis.PlayerState.LOADING
MediaStatus.PLAYER_STATE_PAUSED -> PlatformBridgeApis.PlayerState.PAUSED
MediaStatus.PLAYER_STATE_PLAYING -> PlatformBridgeApis.PlayerState.PLAYING
else -> PlatformBridgeApis.PlayerState.UNKNOWN
}
}
@ -57,11 +57,11 @@ fun getFlutterMediaInfo(mediaInfo: MediaInfo?): PlatformBridgeApis.MediaInfo {
fun getFlutterStreamType(streamType: Int?): PlatformBridgeApis.StreamType {
return when (streamType) {
-1 -> PlatformBridgeApis.StreamType.invalid
0 -> PlatformBridgeApis.StreamType.none
1 -> PlatformBridgeApis.StreamType.buffered
2 -> PlatformBridgeApis.StreamType.live
else -> PlatformBridgeApis.StreamType.invalid
-1 -> PlatformBridgeApis.StreamType.INVALID
0 -> PlatformBridgeApis.StreamType.NONE
1 -> PlatformBridgeApis.StreamType.BUFFERED
2 -> PlatformBridgeApis.StreamType.LIVE
else -> PlatformBridgeApis.StreamType.INVALID
}
}
@ -107,24 +107,24 @@ fun getFlutterAdBreakClipInfo(adBreakClipInfo: AdBreakClipInfo?): PlatformBridge
fun getFlutterType(type: Int?): PlatformBridgeApis.TrackType {
return when (type) {
0 -> PlatformBridgeApis.TrackType.unknown
1 -> PlatformBridgeApis.TrackType.text
2 -> PlatformBridgeApis.TrackType.audio
3 -> PlatformBridgeApis.TrackType.video
else -> PlatformBridgeApis.TrackType.unknown
0 -> PlatformBridgeApis.TrackType.UNKNOWN
1 -> PlatformBridgeApis.TrackType.TEXT
2 -> PlatformBridgeApis.TrackType.AUDIO
3 -> PlatformBridgeApis.TrackType.VIDEO
else -> PlatformBridgeApis.TrackType.UNKNOWN
}
}
fun getFlutterSubtype(subtype: Int?): PlatformBridgeApis.TrackSubtype {
return when (subtype) {
-1 -> PlatformBridgeApis.TrackSubtype.unknown
0 -> PlatformBridgeApis.TrackSubtype.none
1 -> PlatformBridgeApis.TrackSubtype.subtitles
2 -> PlatformBridgeApis.TrackSubtype.captions
3 -> PlatformBridgeApis.TrackSubtype.descriptions
4 -> PlatformBridgeApis.TrackSubtype.chapters
5 -> PlatformBridgeApis.TrackSubtype.metadata
else -> PlatformBridgeApis.TrackSubtype.unknown
-1 -> PlatformBridgeApis.TrackSubtype.UNKNOWN
0 -> PlatformBridgeApis.TrackSubtype.NONE
1 -> PlatformBridgeApis.TrackSubtype.SUBTITLES
2 -> PlatformBridgeApis.TrackSubtype.CAPTIONS
3 -> PlatformBridgeApis.TrackSubtype.DESCRIPTIONS
4 -> PlatformBridgeApis.TrackSubtype.CHAPTERS
5 -> PlatformBridgeApis.TrackSubtype.METADATA
else -> PlatformBridgeApis.TrackSubtype.UNKNOWN
}
}
@ -150,14 +150,14 @@ fun getFlutterWebImages(images: List<WebImage>?): List<PlatformBridgeApis.WebIma
fun getFlutterMediaType(mediaType: Int?): PlatformBridgeApis.MediaType {
return when (mediaType) {
0 -> PlatformBridgeApis.MediaType.generic
1 -> PlatformBridgeApis.MediaType.movie
2 -> PlatformBridgeApis.MediaType.tvShow
3 -> PlatformBridgeApis.MediaType.musicTrack
4 -> PlatformBridgeApis.MediaType.photo
5 -> PlatformBridgeApis.MediaType.audiobookChapter
100 -> PlatformBridgeApis.MediaType.user
else -> PlatformBridgeApis.MediaType.generic
0 -> PlatformBridgeApis.MediaType.GENERIC
1 -> PlatformBridgeApis.MediaType.MOVIE
2 -> PlatformBridgeApis.MediaType.TV_SHOW
3 -> PlatformBridgeApis.MediaType.MUSIC_TRACK
4 -> PlatformBridgeApis.MediaType.PHOTO
5 -> PlatformBridgeApis.MediaType.AUDIOBOOK_CHAPTER
100 -> PlatformBridgeApis.MediaType.USER
else -> PlatformBridgeApis.MediaType.GENERIC
}
}
@ -168,34 +168,34 @@ fun getFlutterStrings(mediaMetadata: MediaMetadata?): Map<String, String> {
fun getFlutterMediaMetadataKey(mediaMetadataKey: String): String {
return when (mediaMetadataKey) {
"com.google.android.gms.cast.metadata.ALBUM_ARTIST" -> PlatformBridgeApis.MediaMetadataKey.albumArtist.name
"com.google.android.gms.cast.metadata.ALBUM_TITLE" -> PlatformBridgeApis.MediaMetadataKey.albumTitle.name
"com.google.android.gms.cast.metadata.ARTIST" -> PlatformBridgeApis.MediaMetadataKey.artist.name
"com.google.android.gms.cast.metadata.BOOK_TITLE" -> PlatformBridgeApis.MediaMetadataKey.bookTitle.name
"com.google.android.gms.cast.metadata.BROADCAST_DATE" -> PlatformBridgeApis.MediaMetadataKey.broadcastDate.name
"com.google.android.gms.cast.metadata.CHAPTER_NUMBER" -> PlatformBridgeApis.MediaMetadataKey.chapterNumber.name
"com.google.android.gms.cast.metadata.CHAPTER_TITLE" -> PlatformBridgeApis.MediaMetadataKey.chapterTitle.name
"com.google.android.gms.cast.metadata.COMPOSER" -> PlatformBridgeApis.MediaMetadataKey.composer.name
"com.google.android.gms.cast.metadata.CREATION_DATE" -> PlatformBridgeApis.MediaMetadataKey.creationDate.name
"com.google.android.gms.cast.metadata.DISC_NUMBER" -> PlatformBridgeApis.MediaMetadataKey.discNumber.name
"com.google.android.gms.cast.metadata.EPISODE_NUMBER" -> PlatformBridgeApis.MediaMetadataKey.episodeNumber.name
"com.google.android.gms.cast.metadata.HEIGHT" -> PlatformBridgeApis.MediaMetadataKey.height.name
"com.google.android.gms.cast.metadata.LOCATION_LATITUDE" -> PlatformBridgeApis.MediaMetadataKey.locationLatitude.name
"com.google.android.gms.cast.metadata.LOCATION_LONGITUDE" -> PlatformBridgeApis.MediaMetadataKey.locationLongitude.name
"com.google.android.gms.cast.metadata.LOCATION_NAME" -> PlatformBridgeApis.MediaMetadataKey.locationName.name
"com.google.android.gms.cast.metadata.QUEUE_ITEM_ID" -> PlatformBridgeApis.MediaMetadataKey.queueItemId.name
"com.google.android.gms.cast.metadata.RELEASE_DATE" -> PlatformBridgeApis.MediaMetadataKey.releaseDate.name
"com.google.android.gms.cast.metadata.SEASON_NUMBER" -> PlatformBridgeApis.MediaMetadataKey.seasonNumber.name
"com.google.android.gms.cast.metadata.SECTION_DURATION" -> PlatformBridgeApis.MediaMetadataKey.sectionDuration.name
"com.google.android.gms.cast.metadata.SECTION_START_ABSOLUTE_TIME" -> PlatformBridgeApis.MediaMetadataKey.sectionStartAbsoluteTime.name
"com.google.android.gms.cast.metadata.SECTION_START_TIME_IN_CONTAINER" -> PlatformBridgeApis.MediaMetadataKey.sectionStartTimeInContainer.name
"com.google.android.gms.cast.metadata.SECTION_START_TIME_IN_MEDIA" -> PlatformBridgeApis.MediaMetadataKey.sectionStartTimeInMedia.name
"com.google.android.gms.cast.metadata.SERIES_TITLE" -> PlatformBridgeApis.MediaMetadataKey.seriesTitle.name
"com.google.android.gms.cast.metadata.STUDIO" -> PlatformBridgeApis.MediaMetadataKey.studio.name
"com.google.android.gms.cast.metadata.SUBTITLE" -> PlatformBridgeApis.MediaMetadataKey.subtitle.name
"com.google.android.gms.cast.metadata.TITLE" -> PlatformBridgeApis.MediaMetadataKey.title.name
"com.google.android.gms.cast.metadata.TRACK_NUMBER" -> PlatformBridgeApis.MediaMetadataKey.trackNumber.name
"com.google.android.gms.cast.metadata.WIDTH" -> PlatformBridgeApis.MediaMetadataKey.width.name
"com.google.android.gms.cast.metadata.ALBUM_ARTIST" -> PlatformBridgeApis.MediaMetadataKey.ALBUM_ARTIST.name
"com.google.android.gms.cast.metadata.ALBUM_TITLE" -> PlatformBridgeApis.MediaMetadataKey.ALBUM_TITLE.name
"com.google.android.gms.cast.metadata.ARTIST" -> PlatformBridgeApis.MediaMetadataKey.ARTIST.name
"com.google.android.gms.cast.metadata.BOOK_TITLE" -> PlatformBridgeApis.MediaMetadataKey.BOOK_TITLE.name
"com.google.android.gms.cast.metadata.BROADCAST_DATE" -> PlatformBridgeApis.MediaMetadataKey.BROADCAST_DATE.name
"com.google.android.gms.cast.metadata.CHAPTER_NUMBER" -> PlatformBridgeApis.MediaMetadataKey.CHAPTER_NUMBER.name
"com.google.android.gms.cast.metadata.CHAPTER_TITLE" -> PlatformBridgeApis.MediaMetadataKey.CHAPTER_TITLE.name
"com.google.android.gms.cast.metadata.COMPOSER" -> PlatformBridgeApis.MediaMetadataKey.COMPOSER.name
"com.google.android.gms.cast.metadata.CREATION_DATE" -> PlatformBridgeApis.MediaMetadataKey.CREATION_DATE.name
"com.google.android.gms.cast.metadata.DISC_NUMBER" -> PlatformBridgeApis.MediaMetadataKey.DISC_NUMBER.name
"com.google.android.gms.cast.metadata.EPISODE_NUMBER" -> PlatformBridgeApis.MediaMetadataKey.EPISODE_NUMBER.name
"com.google.android.gms.cast.metadata.HEIGHT" -> PlatformBridgeApis.MediaMetadataKey.HEIGHT.name
"com.google.android.gms.cast.metadata.LOCATION_LATITUDE" -> PlatformBridgeApis.MediaMetadataKey.LOCATION_LATITUDE.name
"com.google.android.gms.cast.metadata.LOCATION_LONGITUDE" -> PlatformBridgeApis.MediaMetadataKey.LOCATION_LONGITUDE.name
"com.google.android.gms.cast.metadata.LOCATION_NAME" -> PlatformBridgeApis.MediaMetadataKey.LOCATION_NAME.name
"com.google.android.gms.cast.metadata.QUEUE_ITEM_ID" -> PlatformBridgeApis.MediaMetadataKey.QUEUE_ITEM_ID.name
"com.google.android.gms.cast.metadata.RELEASE_DATE" -> PlatformBridgeApis.MediaMetadataKey.RELEASE_DATE.name
"com.google.android.gms.cast.metadata.SEASON_NUMBER" -> PlatformBridgeApis.MediaMetadataKey.SEASON_NUMBER.name
"com.google.android.gms.cast.metadata.SECTION_DURATION" -> PlatformBridgeApis.MediaMetadataKey.SECTION_DURATION.name
"com.google.android.gms.cast.metadata.SECTION_START_ABSOLUTE_TIME" -> PlatformBridgeApis.MediaMetadataKey.SECTION_START_ABSOLUTE_TIME.name
"com.google.android.gms.cast.metadata.SECTION_START_TIME_IN_CONTAINER" -> PlatformBridgeApis.MediaMetadataKey.SECTION_START_TIME_IN_CONTAINER.name
"com.google.android.gms.cast.metadata.SECTION_START_TIME_IN_MEDIA" -> PlatformBridgeApis.MediaMetadataKey.SECTION_START_TIME_IN_MEDIA.name
"com.google.android.gms.cast.metadata.SERIES_TITLE" -> PlatformBridgeApis.MediaMetadataKey.SERIES_TITLE.name
"com.google.android.gms.cast.metadata.STUDIO" -> PlatformBridgeApis.MediaMetadataKey.STUDIO.name
"com.google.android.gms.cast.metadata.SUBTITLE" -> PlatformBridgeApis.MediaMetadataKey.SUBTITLE.name
"com.google.android.gms.cast.metadata.TITLE" -> PlatformBridgeApis.MediaMetadataKey.TITLE.name
"com.google.android.gms.cast.metadata.TRACK_NUMBER" -> PlatformBridgeApis.MediaMetadataKey.TRACK_NUMBER.name
"com.google.android.gms.cast.metadata.WIDTH" -> PlatformBridgeApis.MediaMetadataKey.WIDTH.name
else -> mediaMetadataKey
}
}

View file

@ -47,10 +47,10 @@ fun getMediaInfo(mediaInfo: PlatformBridgeApis.MediaInfo?): MediaInfo? {
fun getStreamType(streamType: PlatformBridgeApis.StreamType): Int {
return when (streamType) {
PlatformBridgeApis.StreamType.invalid -> -1
PlatformBridgeApis.StreamType.none -> 0
PlatformBridgeApis.StreamType.buffered -> 1
PlatformBridgeApis.StreamType.live -> 2
PlatformBridgeApis.StreamType.INVALID -> -1
PlatformBridgeApis.StreamType.NONE -> 0
PlatformBridgeApis.StreamType.BUFFERED -> 1
PlatformBridgeApis.StreamType.LIVE -> 2
}
}
@ -77,46 +77,46 @@ fun getMediaMetadata(mediaMetadata: PlatformBridgeApis.MediaMetadata): MediaMeta
fun getMediaType(mediaType: PlatformBridgeApis.MediaType): Int {
return when (mediaType) {
PlatformBridgeApis.MediaType.generic -> 0
PlatformBridgeApis.MediaType.movie -> 1
PlatformBridgeApis.MediaType.tvShow -> 2
PlatformBridgeApis.MediaType.musicTrack -> 3
PlatformBridgeApis.MediaType.photo -> 4
PlatformBridgeApis.MediaType.audiobookChapter -> 5
PlatformBridgeApis.MediaType.user -> 100
PlatformBridgeApis.MediaType.GENERIC -> 0
PlatformBridgeApis.MediaType.MOVIE -> 1
PlatformBridgeApis.MediaType.TV_SHOW -> 2
PlatformBridgeApis.MediaType.MUSIC_TRACK -> 3
PlatformBridgeApis.MediaType.PHOTO -> 4
PlatformBridgeApis.MediaType.AUDIOBOOK_CHAPTER -> 5
PlatformBridgeApis.MediaType.USER -> 100
}
}
fun getMediaMetadataKey(mediaMetadataKey: String): String {
return when (mediaMetadataKey) {
PlatformBridgeApis.MediaMetadataKey.albumArtist.name -> "com.google.android.gms.cast.metadata.ALBUM_ARTIST"
PlatformBridgeApis.MediaMetadataKey.albumTitle.name -> "com.google.android.gms.cast.metadata.ALBUM_TITLE"
PlatformBridgeApis.MediaMetadataKey.artist.name -> "com.google.android.gms.cast.metadata.ARTIST"
PlatformBridgeApis.MediaMetadataKey.bookTitle.name -> "com.google.android.gms.cast.metadata.BOOK_TITLE"
PlatformBridgeApis.MediaMetadataKey.broadcastDate.name -> "com.google.android.gms.cast.metadata.BROADCAST_DATE"
PlatformBridgeApis.MediaMetadataKey.chapterNumber.name -> "com.google.android.gms.cast.metadata.CHAPTER_NUMBER"
PlatformBridgeApis.MediaMetadataKey.chapterTitle.name -> "com.google.android.gms.cast.metadata.CHAPTER_TITLE"
PlatformBridgeApis.MediaMetadataKey.composer.name -> "com.google.android.gms.cast.metadata.COMPOSER"
PlatformBridgeApis.MediaMetadataKey.creationDate.name -> "com.google.android.gms.cast.metadata.CREATION_DATE"
PlatformBridgeApis.MediaMetadataKey.discNumber.name -> "com.google.android.gms.cast.metadata.DISC_NUMBER"
PlatformBridgeApis.MediaMetadataKey.episodeNumber.name -> "com.google.android.gms.cast.metadata.EPISODE_NUMBER"
PlatformBridgeApis.MediaMetadataKey.height.name -> "com.google.android.gms.cast.metadata.HEIGHT"
PlatformBridgeApis.MediaMetadataKey.locationLatitude.name -> "com.google.android.gms.cast.metadata.LOCATION_LATITUDE"
PlatformBridgeApis.MediaMetadataKey.locationLongitude.name -> "com.google.android.gms.cast.metadata.LOCATION_LONGITUDE"
PlatformBridgeApis.MediaMetadataKey.locationName.name -> "com.google.android.gms.cast.metadata.LOCATION_NAME"
PlatformBridgeApis.MediaMetadataKey.queueItemId.name -> "com.google.android.gms.cast.metadata.QUEUE_ITEM_ID"
PlatformBridgeApis.MediaMetadataKey.releaseDate.name -> "com.google.android.gms.cast.metadata.RELEASE_DATE"
PlatformBridgeApis.MediaMetadataKey.seasonNumber.name -> "com.google.android.gms.cast.metadata.SEASON_NUMBER"
PlatformBridgeApis.MediaMetadataKey.sectionDuration.name -> "com.google.android.gms.cast.metadata.SECTION_DURATION"
PlatformBridgeApis.MediaMetadataKey.sectionStartAbsoluteTime.name -> "com.google.android.gms.cast.metadata.SECTION_START_ABSOLUTE_TIME"
PlatformBridgeApis.MediaMetadataKey.sectionStartTimeInContainer.name -> "com.google.android.gms.cast.metadata.SECTION_START_TIME_IN_CONTAINER"
PlatformBridgeApis.MediaMetadataKey.sectionStartTimeInMedia.name -> "com.google.android.gms.cast.metadata.SECTION_START_TIME_IN_MEDIA"
PlatformBridgeApis.MediaMetadataKey.seriesTitle.name -> "com.google.android.gms.cast.metadata.SERIES_TITLE"
PlatformBridgeApis.MediaMetadataKey.studio.name -> "com.google.android.gms.cast.metadata.STUDIO"
PlatformBridgeApis.MediaMetadataKey.subtitle.name -> "com.google.android.gms.cast.metadata.SUBTITLE"
PlatformBridgeApis.MediaMetadataKey.title.name -> "com.google.android.gms.cast.metadata.TITLE"
PlatformBridgeApis.MediaMetadataKey.trackNumber.name -> "com.google.android.gms.cast.metadata.TRACK_NUMBER"
PlatformBridgeApis.MediaMetadataKey.width.name -> "com.google.android.gms.cast.metadata.WIDTH"
PlatformBridgeApis.MediaMetadataKey.ALBUM_ARTIST.name -> "com.google.android.gms.cast.metadata.ALBUM_ARTIST"
PlatformBridgeApis.MediaMetadataKey.ALBUM_TITLE.name -> "com.google.android.gms.cast.metadata.ALBUM_TITLE"
PlatformBridgeApis.MediaMetadataKey.ARTIST.name -> "com.google.android.gms.cast.metadata.ARTIST"
PlatformBridgeApis.MediaMetadataKey.BOOK_TITLE.name -> "com.google.android.gms.cast.metadata.BOOK_TITLE"
PlatformBridgeApis.MediaMetadataKey.BROADCAST_DATE.name -> "com.google.android.gms.cast.metadata.BROADCAST_DATE"
PlatformBridgeApis.MediaMetadataKey.CHAPTER_NUMBER.name -> "com.google.android.gms.cast.metadata.CHAPTER_NUMBER"
PlatformBridgeApis.MediaMetadataKey.CHAPTER_TITLE.name -> "com.google.android.gms.cast.metadata.CHAPTER_TITLE"
PlatformBridgeApis.MediaMetadataKey.COMPOSER.name -> "com.google.android.gms.cast.metadata.COMPOSER"
PlatformBridgeApis.MediaMetadataKey.CREATION_DATE.name -> "com.google.android.gms.cast.metadata.CREATION_DATE"
PlatformBridgeApis.MediaMetadataKey.DISC_NUMBER.name -> "com.google.android.gms.cast.metadata.DISC_NUMBER"
PlatformBridgeApis.MediaMetadataKey.EPISODE_NUMBER.name -> "com.google.android.gms.cast.metadata.EPISODE_NUMBER"
PlatformBridgeApis.MediaMetadataKey.HEIGHT.name -> "com.google.android.gms.cast.metadata.HEIGHT"
PlatformBridgeApis.MediaMetadataKey.LOCATION_LATITUDE.name -> "com.google.android.gms.cast.metadata.LOCATION_LATITUDE"
PlatformBridgeApis.MediaMetadataKey.LOCATION_LONGITUDE.name -> "com.google.android.gms.cast.metadata.LOCATION_LONGITUDE"
PlatformBridgeApis.MediaMetadataKey.LOCATION_NAME.name -> "com.google.android.gms.cast.metadata.LOCATION_NAME"
PlatformBridgeApis.MediaMetadataKey.QUEUE_ITEM_ID.name -> "com.google.android.gms.cast.metadata.QUEUE_ITEM_ID"
PlatformBridgeApis.MediaMetadataKey.RELEASE_DATE.name -> "com.google.android.gms.cast.metadata.RELEASE_DATE"
PlatformBridgeApis.MediaMetadataKey.SEASON_NUMBER.name -> "com.google.android.gms.cast.metadata.SEASON_NUMBER"
PlatformBridgeApis.MediaMetadataKey.SECTION_DURATION.name -> "com.google.android.gms.cast.metadata.SECTION_DURATION"
PlatformBridgeApis.MediaMetadataKey.SECTION_START_ABSOLUTE_TIME.name -> "com.google.android.gms.cast.metadata.SECTION_START_ABSOLUTE_TIME"
PlatformBridgeApis.MediaMetadataKey.SECTION_START_TIME_IN_CONTAINER.name -> "com.google.android.gms.cast.metadata.SECTION_START_TIME_IN_CONTAINER"
PlatformBridgeApis.MediaMetadataKey.SECTION_START_TIME_IN_MEDIA.name -> "com.google.android.gms.cast.metadata.SECTION_START_TIME_IN_MEDIA"
PlatformBridgeApis.MediaMetadataKey.SERIES_TITLE.name -> "com.google.android.gms.cast.metadata.SERIES_TITLE"
PlatformBridgeApis.MediaMetadataKey.STUDIO.name -> "com.google.android.gms.cast.metadata.STUDIO"
PlatformBridgeApis.MediaMetadataKey.SUBTITLE.name -> "com.google.android.gms.cast.metadata.SUBTITLE"
PlatformBridgeApis.MediaMetadataKey.TITLE.name -> "com.google.android.gms.cast.metadata.TITLE"
PlatformBridgeApis.MediaMetadataKey.TRACK_NUMBER.name -> "com.google.android.gms.cast.metadata.TRACK_NUMBER"
PlatformBridgeApis.MediaMetadataKey.WIDTH.name -> "com.google.android.gms.cast.metadata.WIDTH"
else -> throw IllegalArgumentException("mediaMetadataKey.strings keys is incorrect")
}
}
@ -141,22 +141,22 @@ fun getMediaTrack(mediaTrack: PlatformBridgeApis.MediaTrack): MediaTrack {
fun getTrackType(trackType: PlatformBridgeApis.TrackType): Int {
return when (trackType) {
PlatformBridgeApis.TrackType.unknown -> 0
PlatformBridgeApis.TrackType.text -> 1
PlatformBridgeApis.TrackType.audio -> 2
PlatformBridgeApis.TrackType.video -> 3
PlatformBridgeApis.TrackType.UNKNOWN -> 0
PlatformBridgeApis.TrackType.TEXT -> 1
PlatformBridgeApis.TrackType.AUDIO -> 2
PlatformBridgeApis.TrackType.VIDEO -> 3
}
}
fun getTrackSubtype(trackSubtype: PlatformBridgeApis.TrackSubtype): Int {
return when (trackSubtype) {
PlatformBridgeApis.TrackSubtype.unknown -> -1
PlatformBridgeApis.TrackSubtype.none -> 0
PlatformBridgeApis.TrackSubtype.subtitles -> 1
PlatformBridgeApis.TrackSubtype.captions -> 2
PlatformBridgeApis.TrackSubtype.descriptions -> 3
PlatformBridgeApis.TrackSubtype.chapters -> 4
PlatformBridgeApis.TrackSubtype.metadata -> 5
PlatformBridgeApis.TrackSubtype.UNKNOWN -> -1
PlatformBridgeApis.TrackSubtype.NONE -> 0
PlatformBridgeApis.TrackSubtype.SUBTITLES -> 1
PlatformBridgeApis.TrackSubtype.CAPTIONS -> 2
PlatformBridgeApis.TrackSubtype.DESCRIPTIONS -> 3
PlatformBridgeApis.TrackSubtype.CHAPTERS -> 4
PlatformBridgeApis.TrackSubtype.METADATA -> 5
}
}

View file

@ -26,21 +26,18 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 31
compileSdkVersion 33
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.gianlucaparadise.flutter_cast_framework_example"
minSdkVersion 16
targetSdkVersion 30
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -53,6 +50,10 @@ android {
signingConfig signingConfigs.debug
}
}
lint {
disable 'InvalidPackage'
}
namespace 'com.gianlucaparadise.flutter_cast_framework_example'
}
flutter {

View file

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gianlucaparadise.flutter_cast_framework_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->

View file

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gianlucaparadise.flutter_cast_framework_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
@ -12,6 +11,7 @@
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:exported="true"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"

View file

@ -9,7 +9,7 @@ import com.google.android.gms.cast.framework.SessionProvider
class CastOptionsProvider : OptionsProvider {
override fun getCastOptions(context: Context): CastOptions {
return CastOptions.Builder()
.setReceiverApplicationId("D6760CCD")
.setReceiverApplicationId("CC1AD845")
.build()
}

View file

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gianlucaparadise.flutter_cast_framework_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->

View file

@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.5.31'
ext.kotlin_version = '1.6.21'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

View file

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip

View file

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

View file

@ -36,6 +36,6 @@ SPEC CHECKSUMS:
GTMSessionFetcher: 43748f93435c2aa068b1cbe39655aaf600652e91
Protobuf: e9b99dd5da72f665ec503b19191f245a22188b4d
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
COCOAPODS: 1.11.3
COCOAPODS: 1.12.0

View file

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
@ -171,7 +171,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
@ -217,6 +217,7 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -231,6 +232,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -380,7 +382,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
@ -402,7 +404,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
@ -463,7 +465,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@ -512,7 +514,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@ -536,7 +538,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
@ -567,7 +569,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View file

@ -4,7 +4,7 @@ import GoogleCast
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate, GCKLoggerDelegate {
let kReceiverAppID = "D6760CCD"
let kReceiverAppID = "CC1AD845"
let kDebugLoggingEnabled = true
override func application(

View file

@ -41,5 +41,9 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>

View file

@ -1,5 +1,5 @@
import 'package:flutter/foundation.dart';
import 'package:flutter_cast_framework/cast.dart';
import 'package:recase/recase.dart';
/// in seconds
const double QUEUE_PRELOAD_TIME = 20;
@ -92,8 +92,8 @@ MediaInfo _getMediaInfo(VideoInfo video) {
final mediaMetadata = MediaMetadata()
..mediaType = MediaType.movie
..strings = {
describeEnum(MediaMetadataKey.title): video.title,
describeEnum(MediaMetadataKey.subtitle): video.studio,
MediaMetadataKey.title.name.constantCase: video.title,
MediaMetadataKey.subtitle.name.constantCase: video.studio,
}
..webImages = [
img,

View file

@ -1,6 +1,6 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_cast_framework/cast.dart';
import 'package:recase/recase.dart';
class QueueItemHeading extends StatelessWidget {
final MediaInfo? mediaInfo;
@ -13,9 +13,9 @@ class QueueItemHeading extends StatelessWidget {
@override
Widget build(BuildContext context) {
final titleText = mediaInfo
?.mediaMetadata?.strings?[describeEnum(MediaMetadataKey.title)];
?.mediaMetadata?.strings?[MediaMetadataKey.title.name.constantCase];
final subtitleText = mediaInfo
?.mediaMetadata?.strings?[describeEnum(MediaMetadataKey.subtitle)];
?.mediaMetadata?.strings?[MediaMetadataKey.subtitle.name.constantCase];
return Column(
crossAxisAlignment: CrossAxisAlignment.start,

View file

@ -53,10 +53,10 @@ packages:
dependency: "direct main"
description:
name: cupertino_icons
sha256: a937da4c006989739ceb4d10e3bd6cce64ca85d0fe287fc5b2b9f6ee757dcee6
sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be
url: "https://pub.dev"
source: hosted
version: "0.1.3"
version: "1.0.5"
fake_async:
dependency: transitive
description:
@ -146,6 +146,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.1.0"
recase:
dependency: transitive
description:
name: recase
sha256: e4eb4ec2dcdee52dcf99cb4ceabaffc631d7424ee55e56f280bc039737f89213
url: "https://pub.dev"
source: hosted
version: "4.1.0"
sky_engine:
dependency: transitive
description: flutter
@ -203,10 +211,10 @@ packages:
dependency: "direct main"
description:
name: transparent_image
sha256: e566a616922a781489f4d91cc939b1b3203b6e4a093317805f2f82f0bb0f8dec
sha256: e8991d955a2094e197ca24c645efec2faf4285772a4746126ca12875e54ca02f
url: "https://pub.dev"
source: hosted
version: "2.0.0"
version: "2.0.1"
vector_graphics:
dependency: transitive
description:

View file

@ -12,8 +12,8 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
transparent_image: ^2.0.0
cupertino_icons: ^1.0.5
transparent_image: ^2.0.1
dev_dependencies:
flutter_test:

View file

@ -25,7 +25,7 @@ class MessageCastingChannel : GCKCastChannel {
castMessage.namespace = namespace
castMessage.message = message
flutterApi.onMessageReceivedMessage(castMessage) { (_: Error?) in
flutterApi.onMessageReceivedMessage(castMessage) { (_: FlutterError?) in
}
}

View file

@ -1,6 +1,8 @@
// Autogenerated from Pigeon (v3.1.0), do not edit directly.
// Autogenerated from Pigeon (v9.0.7), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#import <Foundation/Foundation.h>
@protocol FlutterBinaryMessenger;
@protocol FlutterMessageCodec;
@class FlutterError;
@ -8,77 +10,139 @@
NS_ASSUME_NONNULL_BEGIN
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaInfo
typedef NS_ENUM(NSUInteger, StreamType) {
/// An invalid (unknown) stream type.
StreamTypeInvalid = 0,
/// A stream type of "none".
StreamTypeNone = 1,
/// A buffered stream type.
StreamTypeBuffered = 2,
/// A live stream type.
StreamTypeLive = 3,
};
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaMetadata
typedef NS_ENUM(NSUInteger, MediaType) {
/// A media type representing generic media content.
MediaTypeGeneric = 0,
/// A media type representing a movie.
MediaTypeMovie = 1,
/// A media type representing an TV show.
MediaTypeTvShow = 2,
/// A media type representing a music track.
MediaTypeMusicTrack = 3,
/// A media type representing a photo.
MediaTypePhoto = 4,
/// A media type representing an audiobook chapter.
MediaTypeAudiobookChapter = 5,
/// The smallest media type value that can be assigned for application-defined media types.
MediaTypeUser = 6,
};
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaMetadata
typedef NS_ENUM(NSUInteger, MediaMetadataKey) {
/// String key: Album artist.
MediaMetadataKeyAlbumArtist = 0,
/// String key: Album title.
MediaMetadataKeyAlbumTitle = 1,
/// String key: Artist.
MediaMetadataKeyArtist = 2,
/// String key: Audiobook title.
MediaMetadataKeyBookTitle = 3,
/// String key: Broadcast date.
MediaMetadataKeyBroadcastDate = 4,
/// String key: Chapter number.
MediaMetadataKeyChapterNumber = 5,
/// String key: Chapter title.
MediaMetadataKeyChapterTitle = 6,
/// String key: Composer.
MediaMetadataKeyComposer = 7,
/// String key: Creation date.
MediaMetadataKeyCreationDate = 8,
/// Integer key: Disc number.
MediaMetadataKeyDiscNumber = 9,
/// Integer key: Episode number.
MediaMetadataKeyEpisodeNumber = 10,
/// Integer key: Height.
MediaMetadataKeyHeight = 11,
/// Double key: Location latitude.
MediaMetadataKeyLocationLatitude = 12,
/// Double key: Location longitude.
MediaMetadataKeyLocationLongitude = 13,
/// String key: Location name.
MediaMetadataKeyLocationName = 14,
/// Int key: Queue item ID.
MediaMetadataKeyQueueItemId = 15,
/// String key: Release date.
MediaMetadataKeyReleaseDate = 16,
/// Integer key: Season number.
MediaMetadataKeySeasonNumber = 17,
/// Time key in milliseconds: section duration.
MediaMetadataKeySectionDuration = 18,
/// Time key in milliseconds: section start absolute time.
MediaMetadataKeySectionStartAbsoluteTime = 19,
/// Time key in milliseconds: section start time in the container.
MediaMetadataKeySectionStartTimeInContainer = 20,
/// Time key in milliseconds: section start time in media item.
MediaMetadataKeySectionStartTimeInMedia = 21,
/// String key: Series title.
MediaMetadataKeySeriesTitle = 22,
/// String key: Studio.
MediaMetadataKeyStudio = 23,
/// String key: Subtitle.
MediaMetadataKeySubtitle = 24,
/// String key: Title.
MediaMetadataKeyTitle = 25,
/// Integer key: Track number.
MediaMetadataKeyTrackNumber = 26,
/// Integer key: Width.
MediaMetadataKeyWidth = 27,
};
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaTrack
typedef NS_ENUM(NSUInteger, TrackType) {
/// A media track type indicating an unknown track type.
TrackTypeUnknown = 0,
/// A media track type indicating a text track.
TrackTypeText = 1,
/// A media track type indicating an audio track.
TrackTypeAudio = 2,
/// A media track type indicating a video track.
TrackTypeVideo = 3,
};
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaTrack
typedef NS_ENUM(NSUInteger, TrackSubtype) {
/// A media track subtype indicating an unknown subtype.
TrackSubtypeUnknown = 0,
/// A media track subtype indicating no subtype.
TrackSubtypeNone = 1,
/// A media track subtype indicating subtitles.
TrackSubtypeSubtitles = 2,
/// A media track subtype indicating closed captions.
TrackSubtypeCaptions = 3,
/// A media track subtype indicating descriptions.
TrackSubtypeDescriptions = 4,
/// A media track subtype indicating chapters.
TrackSubtypeChapters = 5,
/// A media track subtype indicating metadata.
TrackSubtypeMetadata = 6,
};
/// State of the remote media player
typedef NS_ENUM(NSUInteger, PlayerState) {
/// Constant indicating unknown player state.
PlayerStateUnknown = 0,
/// Constant indicating that the media player is idle.
PlayerStateIdle = 1,
/// Constant indicating that the media player is playing.
PlayerStatePlaying = 2,
/// Constant indicating that the media player is paused.
PlayerStatePaused = 3,
/// Constant indicating that the media player is buffering.
PlayerStateBuffering = 4,
/// Constant indicating that the media player is loading.
PlayerStateLoading = 5,
};
@ -94,6 +158,7 @@ typedef NS_ENUM(NSUInteger, PlayerState) {
@class CastDevice;
@class CastMessage;
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaLoadRequestData
@interface MediaLoadRequestData : NSObject
+ (instancetype)makeWithShouldAutoplay:(nullable NSNumber *)shouldAutoplay
currentTime:(nullable NSNumber *)currentTime
@ -103,6 +168,7 @@ typedef NS_ENUM(NSUInteger, PlayerState) {
@property(nonatomic, strong, nullable) MediaInfo * mediaInfo;
@end
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaInfo
@interface MediaInfo : NSObject
+ (instancetype)makeWithContentId:(nullable NSString *)contentId
streamType:(StreamType)streamType
@ -119,9 +185,11 @@ typedef NS_ENUM(NSUInteger, PlayerState) {
@property(nonatomic, strong, nullable) NSArray<MediaTrack *> * mediaTracks;
@property(nonatomic, strong, nullable) NSNumber * streamDuration;
@property(nonatomic, strong, nullable) NSArray<AdBreakClipInfo *> * adBreakClips;
/// String containing a json object
@property(nonatomic, copy, nullable) NSString * customDataAsJson;
@end
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaMetadata
@interface MediaMetadata : NSObject
+ (instancetype)makeWithMediaType:(MediaType)mediaType
strings:(nullable NSDictionary<NSString *, NSString *> *)strings
@ -131,11 +199,13 @@ typedef NS_ENUM(NSUInteger, PlayerState) {
@property(nonatomic, strong, nullable) NSArray<WebImage *> * webImages;
@end
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/common/images/WebImage
@interface WebImage : NSObject
+ (instancetype)makeWithUrl:(nullable NSString *)url;
@property(nonatomic, copy, nullable) NSString * url;
@end
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaTrack
@interface MediaTrack : NSObject
+ (instancetype)makeWithId:(nullable NSNumber *)id
trackType:(TrackType)trackType
@ -226,6 +296,7 @@ typedef NS_ENUM(NSUInteger, PlayerState) {
/// The codec used by CastHostApi.
NSObject<FlutterMessageCodec> *CastHostApiGetCodec(void);
/// APIs for Flutter-to-Host comunication
@protocol CastHostApi
- (void)sendMessageMessage:(CastMessage *)message error:(FlutterError *_Nullable *_Nonnull)error;
- (void)showCastDialogWithError:(FlutterError *_Nullable *_Nonnull)error;
@ -254,35 +325,37 @@ extern void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObjec
/// The codec used by CastFlutterApi.
NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec(void);
/// APIs for Host-to-Flutter comunication
@interface CastFlutterApi : NSObject
- (instancetype)initWithBinaryMessenger:(id<FlutterBinaryMessenger>)binaryMessenger;
- (void)getSessionMessageNamespacesWithCompletion:(void(^)(NSArray<NSString *> *_Nullable, NSError *_Nullable))completion;
- (void)onCastStateChangedCastState:(NSNumber *)castState completion:(void(^)(NSError *_Nullable))completion;
- (void)onMessageReceivedMessage:(CastMessage *)message completion:(void(^)(NSError *_Nullable))completion;
- (void)onSessionStartingWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)onSessionStartedWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)onSessionStartFailedWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)onSessionEndingWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)onSessionEndedWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)onSessionResumingWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)onSessionResumedWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)onSessionResumeFailedWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)onSessionSuspendedWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)onStatusUpdatedMediaStatus:(MediaStatus *)mediaStatus completion:(void(^)(NSError *_Nullable))completion;
- (void)onMetadataUpdatedWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)onQueueStatusUpdatedWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)onPreloadStatusUpdatedWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)onSendingRemoteMediaRequestWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)onAdBreakStatusUpdatedMediaStatus:(MediaStatus *)mediaStatus completion:(void(^)(NSError *_Nullable))completion;
- (void)onMediaErrorWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)onProgressUpdatedProgressMs:(NSNumber *)progressMs durationMs:(NSNumber *)durationMs completion:(void(^)(NSError *_Nullable))completion;
- (void)onAdBreakClipProgressUpdatedAdBreakId:(NSString *)adBreakId adBreakClipId:(NSString *)adBreakClipId progressMs:(NSNumber *)progressMs durationMs:(NSNumber *)durationMs whenSkippableMs:(NSNumber *)whenSkippableMs completion:(void(^)(NSError *_Nullable))completion;
- (void)itemsInsertedInRangeInsertIndex:(NSNumber *)insertIndex insertCount:(NSNumber *)insertCount completion:(void(^)(NSError *_Nullable))completion;
- (void)itemsReloadedWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)itemsRemovedAtIndexesIndexes:(NSArray<NSNumber *> *)indexes completion:(void(^)(NSError *_Nullable))completion;
- (void)itemsReorderedAtIndexesIndexes:(NSArray<NSNumber *> *)indexes insertBeforeIndex:(NSNumber *)insertBeforeIndex completion:(void(^)(NSError *_Nullable))completion;
- (void)itemsUpdatedAtIndexesIndexes:(NSArray<NSNumber *> *)indexes completion:(void(^)(NSError *_Nullable))completion;
- (void)mediaQueueChangedWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)mediaQueueWillChangeWithCompletion:(void(^)(NSError *_Nullable))completion;
- (void)getSessionMessageNamespacesWithCompletion:(void (^)(NSArray<NSString *> *_Nullable, FlutterError *_Nullable))completion;
- (void)onCastStateChangedCastState:(NSNumber *)castState completion:(void (^)(FlutterError *_Nullable))completion;
- (void)onMessageReceivedMessage:(CastMessage *)message completion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionStartingWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionStartedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionStartFailedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionEndingWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionEndedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionResumingWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionResumedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionResumeFailedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionSuspendedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onStatusUpdatedMediaStatus:(MediaStatus *)mediaStatus completion:(void (^)(FlutterError *_Nullable))completion;
- (void)onMetadataUpdatedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onQueueStatusUpdatedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onPreloadStatusUpdatedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSendingRemoteMediaRequestWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onAdBreakStatusUpdatedMediaStatus:(MediaStatus *)mediaStatus completion:(void (^)(FlutterError *_Nullable))completion;
- (void)onMediaErrorWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onProgressUpdatedProgressMs:(NSNumber *)progressMs durationMs:(NSNumber *)durationMs completion:(void (^)(FlutterError *_Nullable))completion;
- (void)onAdBreakClipProgressUpdatedAdBreakId:(NSString *)adBreakId adBreakClipId:(NSString *)adBreakClipId progressMs:(NSNumber *)progressMs durationMs:(NSNumber *)durationMs whenSkippableMs:(NSNumber *)whenSkippableMs completion:(void (^)(FlutterError *_Nullable))completion;
- (void)itemsInsertedInRangeInsertIndex:(NSNumber *)insertIndex insertCount:(NSNumber *)insertCount completion:(void (^)(FlutterError *_Nullable))completion;
- (void)itemsReloadedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)itemsRemovedAtIndexesIndexes:(NSArray<NSNumber *> *)indexes completion:(void (^)(FlutterError *_Nullable))completion;
- (void)itemsReorderedAtIndexesIndexes:(NSArray<NSNumber *> *)indexes insertBeforeIndex:(NSNumber *)insertBeforeIndex completion:(void (^)(FlutterError *_Nullable))completion;
- (void)itemsUpdatedAtIndexesIndexes:(NSArray<NSNumber *> *)indexes completion:(void (^)(FlutterError *_Nullable))completion;
- (void)mediaQueueChangedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)mediaQueueWillChangeWithCompletion:(void (^)(FlutterError *_Nullable))completion;
@end
NS_ASSUME_NONNULL_END

File diff suppressed because it is too large Load diff

View file

@ -135,7 +135,7 @@ public class SwiftFlutterCastFrameworkPlugin: NSObject, FlutterPlugin, GCKSessio
let castStateRaw = castState.rawValue
// Android CastStates are 1-to-4, while iOS CastStates are 0-to-3. I align iOS to Android by adding 1
let castStateRawAdjusted = castStateRaw + 1
self.flutterApi.onCastStateChangedCastState(NSNumber(value: castStateRawAdjusted)) { (_: Error?) in
self.flutterApi.onCastStateChangedCastState(NSNumber(value: castStateRawAdjusted)) { (_: FlutterError?) in
}
}
@ -225,7 +225,7 @@ public class SwiftFlutterCastFrameworkPlugin: NSObject, FlutterPlugin, GCKSessio
let nsAdBreakClipDuration = NSNumber(value: adBreakClipDurationMs)
DispatchQueue.main.async {
self.flutterApi.onAdBreakClipProgressUpdatedAdBreakId(adBreakId, adBreakClipId: adBreakClipId, progressMs: nsAdBreakClipProgress, durationMs: nsAdBreakClipDuration, whenSkippableMs: nsWhenSkippable) { (_:Error?) in
self.flutterApi.onAdBreakClipProgressUpdatedAdBreakId(adBreakId, adBreakClipId: adBreakClipId, progressMs: nsAdBreakClipProgress, durationMs: nsAdBreakClipDuration, whenSkippableMs: nsWhenSkippable) { (_:FlutterError?) in
}
}
}
@ -241,7 +241,7 @@ public class SwiftFlutterCastFrameworkPlugin: NSObject, FlutterPlugin, GCKSessio
let nsProgress = NSNumber(value: progressMs)
DispatchQueue.main.async {
self.flutterApi.onProgressUpdatedProgressMs(nsProgress, durationMs: nsDuration) { (_:Error?) in
self.flutterApi.onProgressUpdatedProgressMs(nsProgress, durationMs: nsDuration) { (_:FlutterError?) in
}
}
}
@ -386,14 +386,14 @@ public class SwiftFlutterCastFrameworkPlugin: NSObject, FlutterPlugin, GCKSessio
// onSessionSuspended
public func sessionManager(_ sessionManager: GCKSessionManager, didSuspend session: GCKCastSession, with reason: GCKConnectionSuspendReason) {
debugPrint("SessionListener: didSuspend")
flutterApi.onSessionSuspended { (_:Error?) in
flutterApi.onSessionSuspended { (_:FlutterError?) in
}
}
// onSessionStarting
public func sessionManager(_ sessionManager: GCKSessionManager, willStart session: GCKCastSession) {
debugPrint("SessionListener: willStart")
flutterApi.onSessionStarting { (_:Error?) in
flutterApi.onSessionStarting { (_:FlutterError?) in
}
castSession = session
@ -402,7 +402,7 @@ public class SwiftFlutterCastFrameworkPlugin: NSObject, FlutterPlugin, GCKSessio
// onSessionResuming
public func sessionManager(_ sessionManager: GCKSessionManager, willResumeCastSession session: GCKCastSession) {
debugPrint("SessionListener: willResumeCastSession")
flutterApi.onSessionResuming { (_:Error?) in
flutterApi.onSessionResuming { (_:FlutterError?) in
}
castSession = session
@ -412,14 +412,14 @@ public class SwiftFlutterCastFrameworkPlugin: NSObject, FlutterPlugin, GCKSessio
public func sessionManager(_ sessionManager: GCKSessionManager, willEnd session: GCKCastSession) {
debugPrint("SessionListener: willEnd")
stopProgressTimer()
flutterApi.onSessionEnding { (_:Error?) in
flutterApi.onSessionEnding { (_:FlutterError?) in
}
}
// onSessionStartFailed
public func sessionManager(_ sessionManager: GCKSessionManager, didFailToStart session: GCKCastSession, withError error: Error) {
debugPrint("SessionListener: didFailToStart")
flutterApi.onSessionStartFailed { (_:Error?) in
flutterApi.onSessionStartFailed { (_:FlutterError?) in
}
}
@ -428,7 +428,7 @@ public class SwiftFlutterCastFrameworkPlugin: NSObject, FlutterPlugin, GCKSessio
// onSessionStarted
public func sessionManager(_ sessionManager: GCKSessionManager, didStart session: GCKCastSession) {
debugPrint("SessionListener: didStart")
flutterApi.onSessionStarted { (_:Error?) in
flutterApi.onSessionStarted { (_:FlutterError?) in
}
castSession = session
@ -437,7 +437,7 @@ public class SwiftFlutterCastFrameworkPlugin: NSObject, FlutterPlugin, GCKSessio
// onSessionResumed
public func sessionManager(_ sessionManager: GCKSessionManager, didResumeCastSession session: GCKCastSession) {
debugPrint("SessionListener: didResumeCastSession")
flutterApi.onSessionResumed { (_:Error?) in
flutterApi.onSessionResumed { (_:FlutterError?) in
}
castSession = session
@ -446,21 +446,21 @@ public class SwiftFlutterCastFrameworkPlugin: NSObject, FlutterPlugin, GCKSessio
// onSessionEnded
public func sessionManager(_ sessionManager: GCKSessionManager, didEnd session: GCKCastSession, withError error: Error?) {
debugPrint("SessionListener: didEnd")
flutterApi.onSessionEnded { (_:Error?) in
flutterApi.onSessionEnded { (_:FlutterError?) in
}
}
// onQueueStatusUpdated
public func remoteMediaClientDidUpdateQueue(_ client: GCKRemoteMediaClient) {
debugPrint("RemoteMediaClientListener: didUpdateQueue")
flutterApi.onQueueStatusUpdated { (_:Error?) in
flutterApi.onQueueStatusUpdated { (_:FlutterError?) in
}
}
// onPreloadStatusUpdated
public func remoteMediaClientDidUpdatePreloadStatus(_ client: GCKRemoteMediaClient) {
debugPrint("RemoteMediaClientListener: didUpdatePreloadStatus")
flutterApi.onPreloadStatusUpdated { (_:Error?) in
flutterApi.onPreloadStatusUpdated { (_:FlutterError?) in
}
}
@ -490,9 +490,9 @@ public class SwiftFlutterCastFrameworkPlugin: NSObject, FlutterPlugin, GCKSessio
debugPrint("RemoteMediaClientListener: didUpdate mediaStatus - playerState: \(playerStateLabel)")
let flutterMediaStatus = getFlutterMediaStatus(mediaStatus: mediaStatus)
flutterApi.onStatusUpdatedMediaStatus(flutterMediaStatus) { (_:Error?) in
flutterApi.onStatusUpdatedMediaStatus(flutterMediaStatus) { (_:FlutterError?) in
}
flutterApi.onAdBreakStatusUpdatedMediaStatus(flutterMediaStatus) { (_:Error?) in
flutterApi.onAdBreakStatusUpdatedMediaStatus(flutterMediaStatus) { (_:FlutterError?) in
}
}
@ -502,70 +502,70 @@ public class SwiftFlutterCastFrameworkPlugin: NSObject, FlutterPlugin, GCKSessio
// onMetadataUpdated
public func remoteMediaClient(_ client: GCKRemoteMediaClient, didUpdate mediaMetadata: GCKMediaMetadata?) {
debugPrint("RemoteMediaClientListener: didUpdate mediaMetadata")
flutterApi.onMetadataUpdated { (_:Error?) in
flutterApi.onMetadataUpdated { (_:FlutterError?) in
}
}
// onQueueStatusUpdated
public func remoteMediaClient(_ client: GCKRemoteMediaClient, didReceive queueItems: [GCKMediaQueueItem]) {
debugPrint("RemoteMediaClientListener: didReceive queueItems")
flutterApi.onQueueStatusUpdated { (_:Error?) in
flutterApi.onQueueStatusUpdated { (_:FlutterError?) in
}
}
// onSendingRemoteMediaRequest
public func remoteMediaClient(_ client: GCKRemoteMediaClient, didStartMediaSessionWithID sessionID: Int) {
debugPrint("RemoteMediaClientListener: didStartMediaSessionWithID")
flutterApi.onSendingRemoteMediaRequest { (_:Error?) in
flutterApi.onSendingRemoteMediaRequest { (_:FlutterError?) in
}
}
// onQueueStatusUpdated
public func remoteMediaClient(_ client: GCKRemoteMediaClient, didReceiveQueueItemIDs queueItemIDs: [NSNumber]) {
debugPrint("RemoteMediaClientListener: didReceiveQueueItemIDs")
flutterApi.onQueueStatusUpdated { (_:Error?) in
flutterApi.onQueueStatusUpdated { (_:FlutterError?) in
}
}
// onQueueStatusUpdated
public func remoteMediaClient(_ client: GCKRemoteMediaClient, didUpdateQueueItemsWithIDs queueItemIDs: [NSNumber]) {
debugPrint("RemoteMediaClientListener: didUpdateQueueItemsWithIDs")
flutterApi.onQueueStatusUpdated { (_:Error?) in
flutterApi.onQueueStatusUpdated { (_:FlutterError?) in
}
}
// onQueueStatusUpdated
public func remoteMediaClient(_ client: GCKRemoteMediaClient, didRemoveQueueItemsWithIDs queueItemIDs: [NSNumber]) {
debugPrint("RemoteMediaClientListener: didRemoveQueueItemsWithIDs")
flutterApi.onQueueStatusUpdated { (_:Error?) in
flutterApi.onQueueStatusUpdated { (_:FlutterError?) in
}
}
// onQueueStatusUpdated
public func remoteMediaClient(_ client: GCKRemoteMediaClient, didInsertQueueItemsWithIDs queueItemIDs: [NSNumber], beforeItemWithID beforeItemID: UInt) {
debugPrint("RemoteMediaClientListener: didInsertQueueItemsWithIDs")
flutterApi.onQueueStatusUpdated { (_:Error?) in
flutterApi.onQueueStatusUpdated { (_:FlutterError?) in
}
}
// mediaQueueWillChange
public func mediaQueueWillChange(_ queue: GCKMediaQueue) {
debugPrint("MediaQueueListener: mediaQueueWillChange")
flutterApi.mediaQueueWillChange { (_:Error?) in
flutterApi.mediaQueueWillChange { (_:FlutterError?) in
}
}
// mediaQueueChanged
public func mediaQueueDidChange(_ queue: GCKMediaQueue) {
debugPrint("MediaQueueListener: mediaQueueDidChange")
flutterApi.mediaQueueChanged { (_:Error?) in
flutterApi.mediaQueueChanged { (_:FlutterError?) in
}
}
// itemsReloaded
public func mediaQueueDidReloadItems(_ queue: GCKMediaQueue) {
debugPrint("MediaQueueListener: mediaQueueDidReloadItems")
flutterApi.itemsReloaded { (_:Error?) in
flutterApi.itemsReloaded { (_:FlutterError?) in
}
}
@ -574,21 +574,21 @@ public class SwiftFlutterCastFrameworkPlugin: NSObject, FlutterPlugin, GCKSessio
debugPrint("MediaQueueListener: mediaQueueDidInsertItemsIn")
let count = range.upperBound - range.lowerBound
let start = range.lowerBound
flutterApi.itemsInserted(inRangeInsertIndex: NSNumber(value: start), insertCount: NSNumber(value: count)) { (_:Error?) in
flutterApi.itemsInserted(inRangeInsertIndex: NSNumber(value: start), insertCount: NSNumber(value: count)) { (_:FlutterError?) in
}
}
// itemsUpdatedAtIndexes
public func mediaQueue(_ queue: GCKMediaQueue, didUpdateItemsAtIndexes indexes: [NSNumber]) {
debugPrint("MediaQueueListener: mediaQueueDidUpdateItemsAtIndexes")
flutterApi.itemsUpdated(atIndexesIndexes: indexes) { (_:Error?) in
flutterApi.itemsUpdated(atIndexesIndexes: indexes) { (_:FlutterError?) in
}
}
// itemsRemovedAtIndexes
public func mediaQueue(_ queue: GCKMediaQueue, didRemoveItemsAtIndexes indexes: [NSNumber]) {
debugPrint("MediaQueueListener: mediaQueueDidRemoveItemsAtIndexes")
flutterApi.itemsRemoved(atIndexesIndexes: indexes) { (_:Error?) in
flutterApi.itemsRemoved(atIndexesIndexes: indexes) { (_:FlutterError?) in
}
}

File diff suppressed because it is too large Load diff

View file

@ -251,6 +251,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.3"
recase:
dependency: "direct main"
description:
name: recase
sha256: e4eb4ec2dcdee52dcf99cb4ceabaffc631d7424ee55e56f280bc039737f89213
url: "https://pub.dev"
source: hosted
version: "4.1.0"
sky_engine:
dependency: transitive
description: flutter

View file

@ -13,6 +13,7 @@ dependencies:
sdk: flutter
flutter_svg: ^2.0.4
meta: ^1.8.0
recase: ^4.1.0
dev_dependencies:
dartdoc: ^6.2.0