Increase or Decrease position in mediabrowser!

stefanoa

Active Member
Licensed User
Longtime User
i need to increase/decrease mediabrowser position of 'n' seconds during a file is playing (ex. from position 00:01:20 to 00:01:30).

B4X:
Dim length, position, seconds As Int
length = MB.MediaLength

'--- show position ---
lblPosition2.Text = NumberFormat(DateTime.GetMinute(MB.MediaPosition), 2, 0) & ":" & _
        NumberFormat(DateTime.GetSecond(MB.MediaPosition), 2, 0)& "/" & _

'--- increase/decrease position ---
newposition=DateTime.GetSecond(MB.MediaPosition) + 10 ???????????????????????
MB.MediaSeek (newposition)
   
'--- refresh bar position ---
barPosition.Value = newposition

.....

:sign0085:
 

Informatix

Expert
Licensed User
Longtime User
i need to increase/decrease mediabrowser position of 'n' seconds during a file is playing (ex. from position 00:01:20 to 00:01:30).

:sign0085:

When you type something in B4A, the autocompletion function opens a list with possible candidates and a short help text. Reading this text can be helpful. ;-) E.g. for MediaSeek:
Seeks to specified time position (in ms).
Raises the event "SeekCompleted" when the position change has been completed.

I admit I should have written milliseconds in extenso.
 
Upvote 0

stefanoa

Active Member
Licensed User
Longtime User
ok I solved in this way:

B4X:
'--- move position to +10 seconds (10000 ms) ---
MB.MediaSeek (MB.MediaPosition + 10000)

'--- move position to -5 seconds (5000 ms) ---
MB.MediaSeek (MB.MediaPosition - 5000)

bye
 
Upvote 0
Top