Open rajivenator opened 8 years ago
the same problem
Well I tried implementing Exopllayer instead of Torovideo and it works now.
Did not test it with long list of videos but i guess it should work. Also have used video cache plugin https://github.com/danikula/AndroidVideoCache In my project.
following is my implementation
@Override
public void bind(@Nullable Object object) {
post = (FeedPost) object;
activityId = post.getFeedId();
videoPlayOverlay.setVisibility(View.VISIBLE);
Glide.with(itemView.getContext()).load(post.getFeedUserImg()).diskCacheStrategy(DiskCacheStrategy.RESULT).into(ivUserProfile);
txtUserName.setText(post.getFeedUserName());
HttpProxyCacheServer proxy = ((BaseApplication) (itemView.getContext().getApplicationContext())).getProxy();
String proxyUrl = proxy.getProxyUrl(post.getMediaCDNVideoThumbUrl());
Uri uri = Uri.parse(proxyUrl);
mVideoView.setVideoURI(Uri.parse(post.getMediaCDNUrl()));
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uri)
.setProgressiveRenderingEnabled(true)
.build();
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setImageRequest(request)
.setOldController(ivFeedCenter.getController())
.build();
ivFeedCenter.setController(controller);
videoPlayOverlay.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
if (post.getMediaCaption() != null) {
txtFeedBottom.setText(post.getMediaCaption());
}
HashMap<String, Emotion> emotionHashMap = post.getFeedEmotion();
if (emotionHashMap.containsKey(BaseCore.getInstance().getUserId())) {
if (TextUtils.isEmpty(emotionHashMap.get(BaseCore.getInstance().getUserId()).getEmotionText())) {
llEmo.setVisibility(View.GONE);
} else {
llEmo.setVisibility(View.VISIBLE);
tvEmo.setText(emotionHashMap.get(BaseCore.getInstance().getUserId()).getEmotionText());
}
} else {
llEmo.setVisibility(View.GONE);
}
}
Layout replace torovideo with exovideo
<!-- <im.ene.lab.toro.widget.ToroVideoView
android:id="@+id/video"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:layout_gravity="center"
app:videoScaleMode="fitWidth"
/>-->
<com.devbrackets.android.exomedia.EMVideoView
android:id="@+id/video"
android:layout_width="match_parent"
android:layout_height="match_parent"
EMVideoView:defaultControlsEnabled="true"/>
Hi there, thanks for the issue. I'm away from keyboard for couple days so sorry for the late reply. I made an edit on your comments in code blocks. I will take a look in to your code ASAP.
Hi @eneim Is playing from URL supported or any plans till when can it be supported?
I'm working on a ExoPlayer-supported branch. Hopefully I could release it soon. At the mean time, please either use your ExoMedia implementation (I could have if you have any issue). FYI my implementation (with native MediaPlayer from Android) works well with Big Buck Bunny URL, so I still need some try with other sources to see what happens. Sorry I'm kind of time-shortage recently.
Hi, I have tried to implement your library in my app as it resolves one of the pain points of videos in Recycler view.
This implementation ran for the first time. But later on whenever i run the same app the videos won't play. I get the following in my crash log:
Tried on Lollipop and Marshmallow phones. The videos load once and later don't work I am using 1.2.0 library of TORO