mirror of
https://github.com/samsonjs/media.git
synced 2026-06-30 05:49:33 +00:00
The `PreloadMediaSource` has below two new public methods that suppose to be called by the app: * `preload(long)` allows the apps to preload the source at the passed start position before playback. The preload efforts include preparing the source for a `Timeline`, creating and caching a `MediaPeriod`, preparing the period, selecting tracks on the period and continuing loading the data on the period. * `releasePreloadMediaSource()` allows the apps to release the preloaded progress. The `PreloadMediaPeriod` is designed to facilitate the `PreloadMediaSource` for the preloading work. It has a new package-private method `selectTracksForPreloading` which will cache the `SampleStream` that corresponds to the track selection made during the preloading, and when the `PreloadMediaPeriod.selectTracks` is called for playback, it will uses the preloaded streams if the new selection is equal to the selection made during the preloading. Also add a shortform demo module to demo the usage of `PreloadMediaSource` with the short-form content use case. PiperOrigin-RevId: 574439529
46 lines
1.6 KiB
XML
46 lines
1.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- Copyright 2023 The Android Open Source Project
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
-->
|
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:tools="http://schemas.android.com/tools"
|
|
package="androidx.media3.demo.shortform">
|
|
|
|
<application
|
|
android:allowBackup="false"
|
|
android:icon="@mipmap/ic_launcher"
|
|
android:label="@string/app_name"
|
|
android:name="androidx.multidex.MultiDexApplication"
|
|
android:theme="@style/Theme.MaterialComponents.DayNight.NoActionBar"
|
|
android:taskAffinity=""
|
|
tools:replace="android:name">
|
|
<activity
|
|
android:exported="true"
|
|
android:name=".MainActivity">
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.MAIN" />
|
|
<category android:name="android.intent.category.LAUNCHER" />
|
|
</intent-filter>
|
|
</activity>
|
|
<activity
|
|
android:exported="false"
|
|
android:label="@string/title_activity_view_pager"
|
|
android:name=".viewpager.ViewPagerActivity"/>
|
|
</application>
|
|
|
|
<uses-permission android:name="android.permission.INTERNET" />
|
|
|
|
<uses-sdk />
|
|
|
|
</manifest>
|