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
I did follow the exact steps with my RecyclerView but cannot inflate the VideoPlayerView inside the row. Help is greatly appreciated !
Here's a part of my logcat, adapter's onCreateView and Model:
android.view.InflateException: Binary XML file line #66: Error inflating class
at android.view.LayoutInflater.createView(LayoutInflater.java:633)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at com.enthu.nocto.models.userInsightFeed.Insight.createView(Insight.java:409)
at com.enthu.nocto.views.adapters.InsightsAdapter.onCreateViewHolder(InsightsAdapter.java:80)
at com.enthu.nocto.views.adapters.InsightsAdapter.onCreateViewHolder(InsightsAdapter.java:50)
at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6367)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5555)```
@Override
public VideoViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
Insight insight = mInsightList.get(viewType);
View resultView = insight.createView(parent, mContext.getResources().getDisplayMetrics().widthPixels);
return new VideoViewHolder(resultView);
}
public View createView(ViewGroup parent, int screenWidth) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_adapter_insights, parent, false);
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
layoutParams.height = screenWidth;
final VideoViewHolder videoViewHolder = new VideoViewHolder(view);
view.setTag(videoViewHolder);
videoViewHolder.mVideoPlayerView.addMediaPlayerListener(new MediaPlayerWrapper.MainThreadMediaPlayerListener() {
@Override
public void onVideoSizeChangedMainThread(int width, int height) {
}
@Override
public void onVideoPreparedMainThread() {
videoViewHolder.mVCover.setVisibility(View.GONE);
}
@Override
public void onVideoCompletionMainThread() {
videoViewHolder.mVCover.setVisibility(View.VISIBLE);
}
@Override
public void onErrorMainThread(int what, int extra) {
videoViewHolder.mVCover.setVisibility(View.VISIBLE);
}
@Override
public void onBufferingUpdateMainThread(int percent) {
}
@Override
public void onVideoStoppedMainThread() {
videoViewHolder.mVCover.setVisibility(View.VISIBLE);
}
});
return view;
}
The text was updated successfully, but these errors were encountered:
Please check if in your XML you are using android:visibility="gone"
In this case and in some devices (I don't know why) this can be a problem, so try to delete "visibility" attribute from XML
Yes, exactly. Also after managing it programmatically, other issues are arising inside RecyclerView onScroll. Also If we have our own response models from api, how do we use the DirectLinkVideoItem ?
Other than a few things like IllegalStateException: cannot stop. Player in mState ERROR and exception in ListItemData and SingleListViewItemActiveCalculator , the videos work great on list :) . This library is so simple and easy to use, kudos! 👍 :)
I did follow the exact steps with my RecyclerView but cannot inflate the VideoPlayerView inside the row. Help is greatly appreciated !
Here's a part of my logcat, adapter's onCreateView and Model:
android.view.InflateException: Binary XML file line #66: Error inflating class
The text was updated successfully, but these errors were encountered: