Comments (2)
I tried not including the mediaSourceFactory
, looks like that was the problem. It started displaying the local subtitles now.
My SimpleCache Manager implementation:
private const val CACHE_DIR_KEY = "player"
@OptIn(UnstableApi::class)
@Singleton
class PlayerCacheManager @Inject constructor(
@ApplicationContext private val context: Context,
) {
private var simpleCache: SimpleCache? = null
/**
*
* Creates an instance of [SimpleCache].
* If the provided [preferredDiskCacheSize] is unset, which is <0,
* the cache will automatically use [NoOpCacheEvictor] as its evictor.
* */
fun getCache(preferredDiskCacheSize: Long): SimpleCache {
if(simpleCache == null) {
simpleCache = SimpleCache(
/* cacheDir = */ File(context.cacheDir, CACHE_DIR_KEY),
// .also { it.deleteOnExit() }, // Ensures always fresh file
/* evictor = */ if(preferredDiskCacheSize <= 0)
NoOpCacheEvictor()
else
LeastRecentlyUsedCacheEvictor(/* maxBytes = */ preferredDiskCacheSize * 1024L * 1024L),
/* databaseProvider = */ StandaloneDatabaseProvider(context)
)
}
return simpleCache!!
}
/**
*
* Simply releases the cache.
* */
fun releaseCache() {
simpleCache?.release()
simpleCache = null
}
}
I dont understand why its not working when a CacheData Factory is set...
from media.
Fixed it. The problem was due to the local subs using the incorrect data source instead of the local one.
from media.
Related Issues (20)
- Packaging Widevine for key rotation HOT 1
- CSAI ads with IMA for live stream? HOT 1
- [Transformer] The color of BitmapOverlay is a little off HOT 5
- Not selecting the correct video track for the video exported from Pixel8 captured motion JPEG HOT 1
- DRM Problem (VR Split Screen with Multiple SurfaceView)
- Output switcher appears broken after switching to CastPlayer HOT 8
- FMP4 Multiple Media Sources Seamless seek HOT 2
- Ability to set Dialog for TrackSelectionDialogBuilder
- Killing the app while audio is playing results in "The controller is not connected" and not being able to play again HOT 14
- Battery HOT 3
- Loading custom shaders in media player? HOT 1
- Audio stops playing, the player doesn't stop nor reports an error HOT 2
- How to Add subtitle files or url during playing ? HOT 2
- Playback Resumption with external applications HOT 2
- Videos filmed vertically are rotated 90 degrees on Android 9
- Problem with skippable pre-roll ads when seeking the player to resume a playback HOT 2
- Is it possible with media3 to replace the MediaMetadataRetriever thumbnail extraction functionality? HOT 1
- last frame is black when show VAST ads HOT 13
- DecoderCounters reset before `onVideoDisabled()` is delivered. HOT 1
- Broken playback resumption HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from media.