3

For example, I want to replace the implementation of Mp4Extractor(a final class) in Exoplayer with my own version. How can I achieve this?

Something like (which does not exist now):

implementation 'com.google.android.exoplayer:exoplayer-core:2.8.4' {
    exclude package: 'com.google.android.exoplayer.extractor.mp4'
}

This is different from excluding certain java classes in the source tree, but from the remote library. P.S. I have already tried as suggested on https://developer.android.com/studio/build/dependencies but it does not work.

implementation ( 'com.google.android.exoplayer:exoplayer-core:2.8.4' ){
    exclude group: 'com.google.android.exoplayer:exoplayer-core', module: 'mp4'
}

The purpose is to patch the Mp4Extractor implementation in the library for new codec supporting without modifying other classes which use "com.google.android.exoplayer.extractor.mp4".

Does anyone have a good idea?

Mike
  • 2,547
  • 3
  • 16
  • 30
Robin
  • 10,052
  • 6
  • 31
  • 52

0 Answers0