966 Commits

Author SHA1 Message Date
ibaker
5e96d355e1 Suppress NewApi lint warning on <vector> usage in drawables
PiperOrigin-RevId: 545207308
2023-07-05 09:08:51 +00:00
kimvde
b358d075a1 Replace usages of deprecated TransformationRequest setter
PiperOrigin-RevId: 543765376
2023-06-29 22:59:06 +00:00
andrewlewis
90c8f642af Pass GlObjectsProvider to methods
By passing this class where it's needed, implementations don't need to store it
in a field (reducing boilerplate) and it's clearer that it can't be unset when
needed.

PiperOrigin-RevId: 542823522
2023-06-23 16:49:12 +00:00
ibaker
8bf40e7355 Add a demo app sample of SubRip muxed into MKV
I created this by:
1. Downloading https://storage.googleapis.com/exoplayer-test-media-1/mkv/android-screens-lavf-56.36.100-aac-avc-main-1280x720.mkv
2. Crafting a `test.srt` file with a text editor
3. Muxing them together:

   ```
   $ mkvmerge -o android-screens-with-subrip.mkv \
       android-screens-lavf-56.36.100-aac-avc-main-1280x720.mkv \
       test.srt
   ```

Tested in the demo app, the subtitle track is selected by default
(default behaviour for Matroska spec afaict).

PiperOrigin-RevId: 540577912
2023-06-19 16:15:43 +01:00
bachinger
bd97dd8519 Rollback of 7956c80f73
*** Original commit ***

Rollback of 2a6f893fba

*** Original commit ***

Set video size to 0/0 when video render is disabled

In terms of MCVR wi...

***

PiperOrigin-RevId: 540525069
2023-06-19 16:09:13 +01:00
tonihei
51fb72b00d Replace deprecated NullableType from checkerframework with our own one
The existing NullableType has been deprecated 5 years ago and causes
crashes in Kotlin apps because Kotlin doesn't recognize this annotation
as a nullable type annotation.

While we can't align on a single @Nullable annotation yet, we can at
least replace this one by JSR305's @Nonnull(MAYBE) as it fulfils all
requirements, including full Kotlin compatiblity. To avoid the
cumbersome name, we can redefine it as our own @NullableType
annotation. (We can't use @Nullable to avoid name clashes with the main
@Nullable annotation from AndroidX)

Issue: google/ExoPlayer#6792
PiperOrigin-RevId: 540497469
2023-06-19 16:08:20 +01:00
bachinger
5afe7552fe Document how to use a custom receiver app with the cast demo
#minor-release
Issue: androidx/media#452
PiperOrigin-RevId: 539915277
2023-06-14 20:30:32 +01:00
bachinger
c2f78db87e Clean up HLS sample for cast demo
Issue: androidx/media#452
#minor-release
PiperOrigin-RevId: 539613535
2023-06-12 14:11:36 +00:00
Tofunmi Adigun-Hameed
9aa519f1ee Merge pull request #371 from tatsuyafujisaki:simplify-loadJSONFromAsset
PiperOrigin-RevId: 538423581
2023-06-08 12:34:08 +00:00
Tofunmi Adigun-Hameed
886717e3fe Merge pull request #439 from kaidokert:pick_workaround
PiperOrigin-RevId: 538209925
2023-06-06 18:15:04 +00:00
Googler
7956c80f73 Rollback of 2a6f893fba
*** Original commit ***

BEGIN_PUBLIC
Set video size to 0/0 when video render is disabled

In terms of MCVR with a `VideoRendererEventListener`, the video size is set to
0/0 right after `onVideoDisabled()` is called and is set to the actual size as
soon as the video size is known after 'onVideoEnabled()`.

For ExoPlayer and in terms of the `Player` interface, `Player.getVideoSize()`
returns a video size of 0/0 when `Player.getCurrentTracks()` does not support
`C.TRACK_TYPE_VIDEO`. This is ensured by the masking behavior

***

PiperOrigin-RevId: 537938947
2023-06-06 18:06:46 +00:00
Tatsuya Fujisaki
4c54a12af2 Simplify loadJSONFromAsset() 2023-06-06 16:12:01 +00:00
Kaido Kert
1d20aa3c8d Add PICK intent for launching with exolist.json
This works around the issue described in #438
2023-06-06 16:33:41 +01:00
christosts
757247e2ae Release MIDI decoder module in open-source
PiperOrigin-RevId: 537034577
2023-06-02 09:18:09 +00:00
jbibik
25bf0c6738 Remove previously deprecated MediaItem.PlaybackProperties in favour of LocalConfiguration.
Deprecated field `MediaItem.playbackProperties` remains for backwards compatibility, but its type is changed from `MediaItem.PlaybackProperties` to `MediaItem.LocalConfiguration`. The private `MediaItem` constructor will now also take in a `LocalConfiguration` argument instead.

PiperOrigin-RevId: 535648420
2023-05-30 10:13:11 +00:00
Googler
86515f8683 Show the file path of the exported output video.
PiperOrigin-RevId: 535233266
2023-05-25 15:11:05 +00:00
bachinger
230921e4ab Use artwork display mode in demo app
- Use artwork display mode `fill` to improve visual apperance
- Some minor cleanup

#minor-release

PiperOrigin-RevId: 534366246
2023-05-24 15:52:15 +01:00
bachinger
46fb454b3f Add artwork display mode to PlayerView
This change deprecates `PlayerView.setUseArtwork(boolean)` and
introduces `setArtworkDisplayMode(mode)` and
`artworkDisplayMode="off|fit|fill"` instead.

- off: no artwork is displayed (like deprecated useArtwork=false)
- fit: letterbox like media (like deprecated useArtwork=true)
- fill: scales the artwork to fill the entire width/weight of the player view

#minor-release

PiperOrigin-RevId: 534167226
2023-05-24 15:47:03 +01:00
bachinger
96a4ae7e40 Minor session demo app improvements
Basically this change removes a bug that makes video playback stuck when
a video is playing and the user taps the UMO notification to get to
the player activity.

- Use `launchMode="singleTop"` for `PlayerActivity`
- Change session activity to a back stacked activity on service `onDestroy`.

Using a back stacked activity `onDestroy()` will be useful once this demo
app implements playback resumption.

The rest of the changes are aesthetic:

- clean up and optimize screen space usage in UI of `PlayerActivity`
- changed some colors, paddings and spacings
- adds a default artwork for the `PlayerView`

PiperOrigin-RevId: 534152052
2023-05-24 15:45:54 +01:00
huangdarwin
a6897aedaa Effect: Add GlTextureInfo release() and accessor methods.
This allows us to disallow access after release.

PiperOrigin-RevId: 534046475
2023-05-24 15:42:47 +01:00
bachinger
2a6f893fba Set video size to 0/0 when video render is disabled
In terms of MCVR with a `VideoRendererEventListener`, the video size is set to
0/0 right after `onVideoDisabled()` is called and is set to the actual size as
soon as the video size is known after 'onVideoEnabled()`.

For ExoPlayer and in terms of the `Player` interface, `Player.getVideoSize()`
returns a video size of 0/0 when `Player.getCurrentTracks()` does not support
`C.TRACK_TYPE_VIDEO`. This is ensured by the masking behavior of
`ExoPlayerImpl` that sets an empty track selection result when the playing
period changes due to a seek or timeline removal.

When transitioning playback from a video media item to the next, or when
seeking within the same video media item, the renderer is not disabled.

#minor-release

PiperOrigin-RevId: 533479600
2023-05-24 15:28:20 +01:00
ibaker
b3db85133a Add android.namespace to all build.gradle files
This is a pre-requisite for the Android Studio upgrade assistant to
upgrade from AGP 7.2.2 to 8.0.1, otherwise it fails and complains
this is missing.

Issue: androidx/media#409
PiperOrigin-RevId: 533463246
2023-05-19 17:19:15 +01:00
bachinger
dab1353aad Enable live DASH stream for IMA DAI
This change enables the IMA extension to play live DASH streams
with DAI support. Samples streams can be found and played in the
main demo app.

Issue: google/ExoPlayer#10912
#minor-release
PiperOrigin-RevId: 532407708
2023-05-17 08:38:06 +01:00
tonihei
804b57ea7b Add LeakCanary to session demo app debug builds
This helps to detect accidental service/activity leaks.

PiperOrigin-RevId: 529391523
2023-05-05 16:41:33 +00:00
ibaker
0f398d511d Temporarily suppress missing permission lint in session demo
#minor-release

PiperOrigin-RevId: 529370535
2023-05-04 13:05:49 +00:00
ibaker
09b474a519 Use a for-each loop instead of forEach in PlaybackService.kt
The current code flags a lint error:

```
Error: Call requires API level 24 (current min is 16): java.lang.Iterable#forEach [NewApi]
```

I think this is a bit confusing because this is calling the Java
[`Iterable.forEach`](https://developer.android.com/reference/java/lang/Iterable#forEach(java.util.function.Consumer%3C?%20super%20T%3E))
method which was added in Java 8 (and therefore is only available on
API 24 and up), but there is **also** a Kotlin
[`List.forEach`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/for-each.html)
method which is available in all versions of Kotlin (and therefore all
Android versions). Since this is a Kotlin file, at first glance you
would assume this is the Kotlin method - but it's not.

This also doesn't seem to be flagged by Android Studio, but is caught
by Gradle lint on the command line.

#minor-release

PiperOrigin-RevId: 529112610
2023-05-03 17:30:52 +00:00
ibaker
ebcdd983e2 Fix demo app UnsafeOptInUsageError lint errors
This change:
* Adds missing `@OptIn` annotation to demo app's `ErrorMessageProvider`
* Switches from `Util.SDK_INT` to `Build.VERSION.SDK_INT` in
  `SampleChooserActivity` (`PlayerActivity` is already using this).

This code hasn't changed recently, and it doesn't fail on the `release`
branch, but it failed when I checked the `main` branch just now - so I
assume lint has updated to detect more cases where unstable APIs are
being used without opt-in. I suspect the difference is due to different
Android Gradle Plugin versions between the branches.

#minor-release

PiperOrigin-RevId: 529111669
2023-05-03 17:29:41 +00:00
bachinger
7938978b51 Allow MediaLibraryService to reject the resumption notification
To reliably reject the System UI playback resumption notification on
all API levels (specifically API 30), the backward compatibility layer
needs to return `null` for the library root.

This is not possible in the Media3 implementation. This change allows
an app to return a `LibraryResult.ofError(RESULT_ERROR_NOT_SUPPORTED)`
that then is translated to return null by the backwards compatibility
layer.

Issue: androidx/media#355
Issue: androidx/media#167
Issue: androidx/media#27

See https://developer.android.com/guide/topics/media/media-controls#mediabrowserservice_implementation

PiperOrigin-RevId: 527276529
2023-04-27 12:23:26 +01:00
tonihei
889f435a49 Update dependencies to latest versions
The only dependencies that are not updated are the ones that need
to be kept in sync with other system (like Android source tree) or
would require a Kotlin dependency in common or exoplayer modules.

As a side effect, some demo apps now need a Kotlin config and some
additional modules require desugaring/multidex logic. To simplify
the setup, the desugaring and multidex steps are added to the common
config.

PiperOrigin-RevId: 527243950
2023-04-26 15:49:57 +01:00
tonihei
2de89ca2ce Remove unnecessary Activity method overrides in session demo app
The PlayerView methods are documented to only be needed for sphrerical
playbacks, which we are not using in the session demo app.

PiperOrigin-RevId: 525986709
2023-04-24 11:29:46 +01:00
bachinger
c623b965c5 Use DataSourceBitmapLoader in session demo app
Issue: androidx/media#327
PiperOrigin-RevId: 525103046
2023-04-18 18:09:24 +01:00
huangdarwin
b61abefd7b Demo: Prefer UNICODE character.
PiperOrigin-RevId: 524802289
2023-04-17 17:18:01 +01:00
tonihei
f2cd34ad01 Fix formatting
PiperOrigin-RevId: 524772236
2023-04-17 17:15:13 +01:00
claincly
eadb78e52a Fix crash when there's no input player view.
This happens when the input is an image. The output will always be video so the
outputPlayer and outputVideoTextView will always present.

PiperOrigin-RevId: 524329436
2023-04-17 17:11:35 +01:00
ibaker
b834e49f9f Use @link instead of @value
Dackka doesn't support `@value`

#minor-release

PiperOrigin-RevId: 524309695
2023-04-17 17:10:49 +01:00
simakova
fab3abfd7c Fix input video duration in the result view in transformer demo
PiperOrigin-RevId: 524305085
2023-04-17 17:09:13 +01:00
claincly
b40f4792f0 Add a portrait image to the demo app.
PiperOrigin-RevId: 524282997
2023-04-17 17:07:03 +01:00
claincly
2ee84b809d Tap the video playback view to switch audio output.
PiperOrigin-RevId: 524027177
2023-04-17 17:02:27 +01:00
rohks
81fd9d2867 Enable multidex for demo-gl app
#minor-release

PiperOrigin-RevId: 523708424
2023-04-12 17:03:15 +01:00
tonihei
be85684dc9 Replace deprecated onBackPressed call
PiperOrigin-RevId: 523361561
2023-04-12 16:47:33 +01:00
tonihei
14ba173dfe Add missing initial update to the subtitle button in the session demo
The button gets only updated after an onTracksChanged callback but
isn't set to the initial state similar to other changes triggered
by callbacks (e.g. updateRepeatSwitchUI)

PiperOrigin-RevId: 522274800
2023-04-11 10:29:32 +01:00
Googler
5af28a980d ...Suppress MissingSuperCall warnings on onBackPressed()...
PiperOrigin-RevId: 520709134
2023-04-05 15:35:22 +01:00
tonihei
6952771e2f Remove remaining references to exoplayer.dev
PiperOrigin-RevId: 520314781
2023-03-30 17:20:36 +00:00
tofunmi
c17e043403 Transformer Demo: Hide playback views during transformation
PiperOrigin-RevId: 518560945
2023-03-30 17:00:11 +00:00
tofunmi
8df4fd769c Log export errors that occur after export completes
PiperOrigin-RevId: 518281002
2023-03-22 10:35:05 +00:00
Googler
7c7a6298ff Fixed TableLayout in demo UI to work with small screens
PiperOrigin-RevId: 518257650
2023-03-21 14:23:29 +00:00
huangdarwin
236748070c Demo: Shorten default trim range from 10s to 1s.
Shorten the demo's default trim range from 0-10s to 0-1s, and change the
UI-supported trim range from 0-60s to 0-10s.

Most demo videos aren't very long, and the default demo is 10 seconds.

The use-case for trimming in the demo seems to be mostly for validating trimming
works, or generating test media. Test media should tend to be short in order to be
small, so shortening the trim range helps this be accomplished more effectively.

PiperOrigin-RevId: 517103583
2023-03-16 15:35:18 +00:00
tofunmi
2c852ea7bb Replace bitmap overlay uri EditText with local file picker
PiperOrigin-RevId: 515283537
2023-03-14 07:47:10 +00:00
tofunmi
68578be372 Update createStaticBitmapOverlay to take in context.
By making this method accept context, we can use DefaultDataSource.Factory in the DatasourceBitmapLoader to support a wider range on URI schemes in Bitmap Overlays. (and implement a local file picker for images for custom bitmap overlays in the demo transformer app)

PiperOrigin-RevId: 515013460
2023-03-14 07:39:43 +00:00
tofunmi
e478d81b52 Update effect to take in and use a GlObjectsProvider
PiperOrigin-RevId: 514744747
2023-03-14 07:33:25 +00:00