如何解决创建 ExoPlayer 轨道选择器对话框时出错
public TrackSelectionViewFragment() {
// Retain instance across activity re-creation to prevent losing access to init data.
setRetainInstance(true);
}
public void init(
MappedTrackInfo mappedTrackInfo,int rendererIndex,boolean initialIsdisabled,@Nullable SelectionOverride initialoverride,boolean allowAdaptiveSelections,boolean allowMultipleOverrides) {
this.mappedTrackInfo = mappedTrackInfo;
this.rendererIndex = rendererIndex;
this.isdisabled = initialIsdisabled;
this.overrides =
initialoverride == null
? Collections.emptyList()
: Collections.singletonList(initialoverride);
this.allowAdaptiveSelections = allowAdaptiveSelections;
this.allowMultipleOverrides = allowMultipleOverrides;
}
@Nullable
@Override
public View onCreateView(
LayoutInflater inflater,@Nullable ViewGroup container,@Nullable Bundle savedInstanceState) {
View rootView =
inflater.inflate(
R.layout.exo_track_selection_dialog,container,/* attachToRoot= */ false);
TrackSelectionView trackSelectionView = rootView.findViewById(R.id.exo_track_selection_view);
trackSelectionView.setShowdisableOption(true);
trackSelectionView.setAllowMultipleOverrides(allowMultipleOverrides);
trackSelectionView.setAllowAdaptiveSelections(allowAdaptiveSelections);
trackSelectionView.init(
mappedTrackInfo,rendererIndex,isdisabled,overrides,this);
return rootView;
}
@Override
public void onTrackSelectionChanged(boolean isdisabled,List<SelectionOverride> overrides) {
this.isdisabled = isdisabled;
this.overrides = overrides;
}
}
这是我制作曲目选择器对话框的代码 但我在 trackSelectionView.init( mappingTrackInfo,this);
需要 trackFormatComparator 来填充参数,现在只有 5 个参数
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。