When I run my app I'm having these issues.
- A black screen flashes for 2 secs and then displays the actual intent of my app.
- The video gets started and when I scroll up/down, the
VideoView
turns white and continues playing. Not able to see the video but plays in background. - After playing is done, for few seconds I'm getting this "Can't play this video" dialog.
This is the excerpt from my Adapter Code:
public class MessageAdapter extends ArrayAdapter<Message> {
private static class ViewHolder {
TextView authorTextView, timeStamp, messageTitle, messageTextView;
VideoView videoView;
ImageView photoImageView;
}
public View getView(int position, View convertView, ViewGroup parent) {
// Gets the message that we are displaying at a position
Message message = getItem(position);
...
boolean isPhoto = message.getPhotoUrl() != null;
boolean isVideo = message.getVideoUrl() != null;
if (isPhoto) {
// Photo Present
} else if (isVideo) {
// Video present
Log.d(TAG, "Video present !");
viewHolder.messageTextView.setVisibility(View.GONE);
viewHolder.photoImageView.setVisibility(View.GONE);
viewHolder.timeStamp.setVisibility(View.VISIBLE);
viewHolder.videoView.setVisibility(View.VISIBLE);
viewHolder.videoView.setVideoPath(message.getVideoUrl());
viewHolder.videoView.start();
Log.d(TAG, "Video URL : "+message.getVideoUrl());
} else {
// Photo and video both absent
}
return convertView;
}
}
I'm getting this on LogCat
:
After displaying the Logged info there is a following warning as shown below
D: Video present !
D: Video URL : https://firebasestorage.googleapis.com/v0/b/xxx.appspot.com/o/photos%2Fvideo%3A34334?alt=media&token=05xf6c2f-6abc-4ab9-b696-32153fa3d0aa
W: Couldn't open https://firebasestorage.googleapis.com/v0/b/xxx.appspot.com/o/photos%2Fvideo%3A34334?alt=media&token=05cf6c2f-6abc-4ab9-b696-32153fa3d0aa: java.io.FileNotFoundException: No content provider: https://firebasestorage.googleapis.com/v0/b/xxx.appspot.com/o/photos%2Fvideo%3A34334?alt=media&token=05cx6c2f-6abc-4ab9-b696-32153fa3d0aa
I: proxyName: 0.0.0.0 0
W: finishComposingText on inactive InputConnection
D: getMetadata
I: proxyName: 0.0.0.0 0
W: info/warning (703, 0)
I: proxyName: 0.0.0.0 0
V: Inactivity, disconnecting from the service
I: proxyName: 0.0.0.0 0
I: proxyName: 0.0.0.0 0
E: error (1, -2147483648)
This is my VideoView
Layout:
<VideoView
android:id = "@+id/admin_video_view"
android:layout_width = "300dp"
android:layout_height = "200dp"
android:layout_weight = "1"
android:layout_marginLeft = "10dp"
android:paddingTop = "5dp"
android:scaleType = "centerCrop" />
MessageAdapter
? orMainActivity
? Can you please guide me. @Featherbrain – Alberic.mp4
movie stored inraw
folder? – Paluas