Hi everyone,
I wonder if you could help me. From my Activity, I am showing a custom dialog with a panel, adding a VideoView to the panel, and setting the width and height (and in the code, the VideoView is set to less than the Panel) of the VideoView to that of the panel.
The problem that I am facing is that video is wider that the panel, and most of the time it is offset higher than the panel (even when I set the Top and Left attributes to 0, 10). The video I am trying to display is an MP4 format. No matter what I do, the videoview does not seem to fit the panel in the customdialog. It just does not resize properly.
Can anyone suggest anything for me?
Code:
'The button contains the name of the video.
'I set this earlier during initialisation
Dim sDirectory As String
Dim this As View
this = Sender
Dim btn As Button
btn = this
Dim foodVideo As VideoView
foodVideo.Initialize("")
VideoPanel.Initialize("")
sDirectory = sRootPath
VideoPanel.AddView(foodVideo, 0, 0, 100%x, 100%y)
'I've also tried
'VideoPanel.AddView(foodVideo, 5%x, 5%y, 90%x, 90%y)
'foodVideo.Left = 0
'foodVideo.Top = 0
foodVideo.Height = 750
foodVideo.Width = 980
foodVideo.LoadVideo(sDirectory, btn.Tag)
foodVideo.BringToFront
foodVideo.VideoQuality(16)
dlg.AddView(VideoPanel, 1020, 760)
ret = dlg.Show("", "", "", "Done", Null)
Dim tim As Timer
tim.Interval = 7000
tim.Enabled = True
foodVideo.Play
tim.Enabled = False
Many thanks,
Laurence
I wonder if you could help me. From my Activity, I am showing a custom dialog with a panel, adding a VideoView to the panel, and setting the width and height (and in the code, the VideoView is set to less than the Panel) of the VideoView to that of the panel.
The problem that I am facing is that video is wider that the panel, and most of the time it is offset higher than the panel (even when I set the Top and Left attributes to 0, 10). The video I am trying to display is an MP4 format. No matter what I do, the videoview does not seem to fit the panel in the customdialog. It just does not resize properly.
Can anyone suggest anything for me?
Code:
'The button contains the name of the video.
'I set this earlier during initialisation
Dim sDirectory As String
Dim this As View
this = Sender
Dim btn As Button
btn = this
Dim foodVideo As VideoView
foodVideo.Initialize("")
VideoPanel.Initialize("")
sDirectory = sRootPath
VideoPanel.AddView(foodVideo, 0, 0, 100%x, 100%y)
'I've also tried
'VideoPanel.AddView(foodVideo, 5%x, 5%y, 90%x, 90%y)
'foodVideo.Left = 0
'foodVideo.Top = 0
foodVideo.Height = 750
foodVideo.Width = 980
foodVideo.LoadVideo(sDirectory, btn.Tag)
foodVideo.BringToFront
foodVideo.VideoQuality(16)
dlg.AddView(VideoPanel, 1020, 760)
ret = dlg.Show("", "", "", "Done", Null)
Dim tim As Timer
tim.Interval = 7000
tim.Enabled = True
foodVideo.Play
tim.Enabled = False
Many thanks,
Laurence