Ilan Peleg
Ilan Peleg

Reputation: 43

How to check if VideoView contains video?

For example, if I have an update screen in which the user is required to upload a video from his device. After pressing "upload" button I want to check whether there is a video in VideoView. This is how I check about the text:

newStatus.isEmpty()||newStatus.trim().isEmpty()

I want something similiar for the VideoView. Thanks!

Upvotes: 4

Views: 792

Answers (1)

user3533716
user3533716

Reputation: 522

Try getDuration(). It seems to return -1 for me before I have loaded a video.

Upvotes: 1

Related Questions