P pixelpop Active Member Licensed User Longtime User Oct 5, 2012 #1 I am streaming a video using the http option in VideoView. I am trying to use ProgressDialogShow while the video is initially being loaded until playing begins. Here is my code, but I can't determine how to remove (hide) ProgressDialogShow after the video begins. Code: phn.SetScreenOrientation(0) ProgressDialogShow("Please wait...") vv.Initialize("vv") Activity.AddView(vv, 0, 0, 100%x, 100%y) vv.LoadVideo("http","{my_video_file_URL}) vv.Play I think the answer may be to relate ProgressDialogHide to the IsPlaying event, but I'm not sure how to use that.
I am streaming a video using the http option in VideoView. I am trying to use ProgressDialogShow while the video is initially being loaded until playing begins. Here is my code, but I can't determine how to remove (hide) ProgressDialogShow after the video begins. Code: phn.SetScreenOrientation(0) ProgressDialogShow("Please wait...") vv.Initialize("vv") Activity.AddView(vv, 0, 0, 100%x, 100%y) vv.LoadVideo("http","{my_video_file_URL}) vv.Play I think the answer may be to relate ProgressDialogHide to the IsPlaying event, but I'm not sure how to use that.
Erel B4X founder Staff member Licensed User Longtime User Oct 5, 2012 #2 IsPlaying will return True immediately after you call vv.Play. There is no event in this case. Upvote 0
P pixelpop Active Member Licensed User Longtime User Oct 5, 2012 #3 So what would you recommend for displaying ProgressDialogShow while the stream is initiated and ProgressDialogHide when the video playing begins? Upvote 0
So what would you recommend for displaying ProgressDialogShow while the stream is initiated and ProgressDialogHide when the video playing begins?
margret Well-Known Member Licensed User Longtime User Oct 5, 2012 #4 You can try something like this: Code: Sub Globals Dim tt As Timer : tt.Initialize("tt", 250) : tt.Enabled = True Dim vv As VideoView : vv.Initialize("vv") End Sub 'Your other code here to load, stream and play Sub tt_Tick If vv.IsPlaying Then ProgressDialogHide tt.Enabled = False End If End Sub Upvote 0
You can try something like this: Code: Sub Globals Dim tt As Timer : tt.Initialize("tt", 250) : tt.Enabled = True Dim vv As VideoView : vv.Initialize("vv") End Sub 'Your other code here to load, stream and play Sub tt_Tick If vv.IsPlaying Then ProgressDialogHide tt.Enabled = False End If End Sub
P pixelpop Active Member Licensed User Longtime User Oct 6, 2012 #5 Wow! That worked! Thanks so much. Upvote 0