You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to enable closed captions for Apple master playlist advanced or other HLS test streams the video is buffering and sometimes it stuck in this state. In order to make the video play again you should go and disable captions and enable them again and video resumes then.
Version used: 2.1.1
Devices: Samsung Galaxy S3 , OS 4.3, Nexus 5, OS 6.0
Also this is happening with ours hls streams that has vtt embeded captions.
@Override
public void setCaptionsState(boolean disabled) {
if (closedCaptionsRendererIndex != -1) {
trackSelector.setRendererDisabled(closedCaptionsRendererIndex, disabled);
if (!disabled) {
enableCaptions();
} else {
trackSelector.clearSelectionOverrides(closedCaptionsRendererIndex);
}
}
}
private void enableCaptions() {
TrackGroupArray trackGroups = trackSelector.getCurrentMappedTrackInfo().getTrackGroups(closedCaptionsRendererIndex);
if (selectionOverride != null) {
setSelectionOverride(closedCaptionsRendererIndex, trackGroups, selectionOverride);
return;
}
for (int groupIndex = 0; groupIndex < trackGroups.length; groupIndex++) {
TrackGroup group = trackGroups.get(groupIndex);
for (int trackIndex = 0; trackIndex < group.length; trackIndex++) {
if (foundPreferredClosedCaptionsTrackIndex(MimeTypes.BASE_TYPE_TEXT, groupIndex, trackIndex, trackGroups, group))
return;
}
}
for (int groupIndex = 0; groupIndex < trackGroups.length; groupIndex++) {
TrackGroup group = trackGroups.get(groupIndex);
for (int trackIndex = 0; trackIndex < group.length; trackIndex++) {
if (foundPreferredClosedCaptionsTrackIndex(MimeTypes.BASE_TYPE_APPLICATION, groupIndex, trackIndex, trackGroups, group))
return;
}
}
}
private boolean foundPreferredClosedCaptionsTrackIndex(String mimeType, int groupIndex, int trackIndex, TrackGroupArray trackGroups, TrackGroup group) {
Format format = group.getFormat(trackIndex);
String formatMimeType = format.sampleMimeType;
if (!(TextUtils.isEmpty(formatMimeType)) && formatMimeType.startsWith(mimeType)) {
selectionOverride = new MappingTrackSelector.SelectionOverride(FIXED_FACTORY, groupIndex, trackIndex);
setSelectionOverride(closedCaptionsRendererIndex, trackGroups, selectionOverride);
return true;
}
return false;
}
private void setSelectionOverride(int rendererIndex, TrackGroupArray trackGroupArray, MappingTrackSelector.SelectionOverride selectionOverride) {
trackSelector.setSelectionOverride(rendererIndex, trackGroupArray, selectionOverride);
}
The text was updated successfully, but these errors were encountered:
Without this, it is possible that a non timestamp master instances
the adjuster with its own chunk start time. When chunks are not
aligned, this breaks adjustment.
Issue:#2424
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149764488
When trying to enable closed captions for Apple master playlist advanced or other HLS test streams the video is buffering and sometimes it stuck in this state. In order to make the video play again you should go and disable captions and enable them again and video resumes then.
Version used: 2.1.1
Devices: Samsung Galaxy S3 , OS 4.3, Nexus 5, OS 6.0
Also this is happening with ours hls streams that has vtt embeded captions.
The text was updated successfully, but these errors were encountered: