Closed AniLabXTeam closed 6 years ago
The exception is thrown due to merging a source that has two periods (the two videos being concatenated) with a source that has one period (the single sample containing subtitles).
This looks like a duplicate of #3812. One way to proceed would be to split up the subtitles into two parts, one corresponding to each video in the concatenation.
@andrewlewis so, there is no any way to merge this files together without sibtitles splitting? Even if duration of each part is known before concatenation (and using ClippingMediaSource) - merge will not work, because concatenating always create more than one peroid?
Concatenation does always create more than one period. I think splitting the subtitles file is going to be the easiest way to fix this.
@andrewlewis thank you for responce. It can lead to errors if some string from subtitles may show in end of first part and on start of second part? Or i need split this string too for exact timings?
Example. First parts duration 14:00. Subtitles has string that showing from 13:58 to 14:05. But this last five seconds in another period. So i need split it too?
Yes. That cue would need to be duplicated at the start of the second section, then the time ranges of the cues would need to be updated.
Issue description
I'm using ConcatenatingMediaSource for two video parts concatenation. This parts is on server. Sometimes, this "parts" has VTT subtitles. And if i try to merge conctatenated sources with SingleSampleMediaSource an prepare player i'l get IllegalMergeException.
How can i merge this sources?
Reproduction steps
Here is my code that i use for merging sources
After prepare i got IllegalMergeException in log and called onPlayerError in Player.EventListener()
Link to test content
part1 = http://lh3.googleusercontent.com/1LRpp1BPxe_5iFXmVcdtwgNlG3nOBhGtqWEiLEi5yGBH1j0gui6CtGLzyGoMdbwrZRNou3-Apu4=m37?ratebypass=yes part2 = http://lh3.googleusercontent.com/vLPk-fZMVObQahl7aYVIcBKB8MaAUWEIJlJ2pjjxgK7k92GXl47xolOHMeA9MfBnxu_-EH5DBpc=m37?ratebypass=yes
subtitlesLink = https://smotret-anime.ru/translations/vtt/542583
Version of ExoPlayer being used
ExoPlayer 2.8.1
Device(s) and version(s) of Android being used
Xiaomi Redmi 4X, Android 8.1 Some users reports that have same issue, but i don't know what phone/Android version they use