Using the media component

Post

Posted
Rating:
#1 (In Topic #208)
Regular
bill-lancaster is in the usergroup ‘Regular’
If I run this code:-

Code

Private gPlayer As New MediaPlayer

Public Sub Form_Open()

gPlayer.URL = User.Home &/ "a.mp3"

End

Public Sub Button1_Click()
Print gPlayer.State;; gPlayer.Length
gPlayer.Play()

End

I get 'cannot set status',  what is missing?
v 3.11.4
Online now: No Back to the top

Post

Posted
Rating:
#2
Regular
vuott is in the usergroup ‘Regular’
Hello,

about audio file path you have to use:

gPlayer.URL = <COLOR color="#800000">Media.URL(</COLOR>User.Home &/ "a.mp3"<COLOR color="#800000">)</COLOR>

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#3
Regular
bill-lancaster is in the usergroup ‘Regular’
Thanks vuott
Online now: No Back to the top

Post

Posted
Rating:
#4
Regular
vuott is in the usergroup ‘Regular’
Just a little example:  

Code (gambas)

  1. Private gPlayer As New MediaPlayer
  2.  
  3. Public Sub Main()
  4.  
  5.   gPlayer.URL = Media.URL(User.Home &/ "a.mp3")
  6.  
  7.   gPlayer.Play()
  8.  
  9.   Print Date(0, 0, 0, 0, 0, 0, gPlayer.Length * 1000)
  10.  
  11.     Write "\r" & CStr(Date(0, 0, 0, 0, 0, 0, gPlayer.Position * 1000))
  12.     Wait 0.001
  13.   Until gPlayer.Position >= gPlayer.Length
  14.  
  15.   gPlayer.Close
  16.  

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top
1 guest and 0 members have just viewed this.