play audiofile from web server
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 20
- Joined: Mon Mar 19, 2018 11:25 pm
play audiofile from web server
Hi there,
Can anybody tell me how I can play an audiofile from an url on iphone and android. If I test the following,
play "<domain-name>/.../sound/math002.aiff", it works well when I try it on PC and Mac.I can´t find anything about this in the LIveCode documentation.
Can anybody tell me how I can play an audiofile from an url on iphone and android. If I test the following,
play "<domain-name>/.../sound/math002.aiff", it works well when I try it on PC and Mac.I can´t find anything about this in the LIveCode documentation.
Re: play audiofile from web server
I think that on mobile you have to use or the browser or the player object.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: play audiofile from web server
"player" objects are desktop-only and not available on the mobile platform!
On mobile you need to use "mobilecontrolcreate" to create a mobile native "player" control.
Then you can use "mobilecontrolset" to set its filename to the url on your server.
On mobile you need to use "mobilecontrolcreate" to create a mobile native "player" control.
Then you can use "mobilecontrolset" to set its filename to the url on your server.
Re: play audiofile from web server
I moved this thread over to the beginners section, since it is really not OFF-TOPIC.
-
- Posts: 20
- Joined: Mon Mar 19, 2018 11:25 pm
Re: play audiofile from web server
Hi Klaus,
I have tested to do as you said; "using mobileControlSet" , but I cannot get it working.,,
This is the code I have used:
on MouseDown
put "h t t p://www.<my domain.s e>/matteapp/sound/math002.mp3" into sLink
mobilecontrolCreate "player","mplayer"
mobileControlSet "mplayer","filename",sLink
mobileControlDo "mplayer", "play"
end MouseDown
Am I doing anything wrong with the code? I have also tested with different types of sound file (wav,mp3,aiff) and with different bitrate for mp3.
I have tested to do as you said; "using mobileControlSet" , but I cannot get it working.,,
This is the code I have used:
on MouseDown
put "h t t p://www.<my domain.s e>/matteapp/sound/math002.mp3" into sLink
mobilecontrolCreate "player","mplayer"
mobileControlSet "mplayer","filename",sLink
mobileControlDo "mplayer", "play"
end MouseDown
Am I doing anything wrong with the code? I have also tested with different types of sound file (wav,mp3,aiff) and with different bitrate for mp3.
Re: play audiofile from web server
Hi Per,
I don't own a mobile device nor do I develop for mobile, but maybe you also need to set the rect and visible property? At least worth a try...
Best
Klaus
I don't own a mobile device nor do I develop for mobile, but maybe you also need to set the rect and visible property? At least worth a try...
Code: Select all
on MouseDown
put "h t t p://www.<my domain.s e>/matteapp/sound/math002.mp3" into sLink
mobilecontrolCreate "player","mplayer"
mobileControlSet "mplayer","rect","0,0,100,20"
mobileControlSet "mplayer","visible",TRUE
## And maybe:
mobileControlSet "mplayer","showcontroller",TRUE
mobileControlSet "mplayer","filename",sLink
mobileControlDo "mplayer", "play"
end MouseDown
Klaus
-
- Posts: 20
- Joined: Mon Mar 19, 2018 11:25 pm
Re: play audiofile from web server
Hi again Klaus!
Thanks for your time an engagement in this task, but unfortunately it didn't help...same result.
Maybe some other "Livecoder" has succeeded in using "mobilecontrolcreate" for playing audio on IOS devices.
I use LC Indy 8.1.9 (rc1) + Xcode 9.2 + MacOS 10.13.3
Thanks for your time an engagement in this task, but unfortunately it didn't help...same result.
Maybe some other "Livecoder" has succeeded in using "mobilecontrolcreate" for playing audio on IOS devices.
I use LC Indy 8.1.9 (rc1) + Xcode 9.2 + MacOS 10.13.3
-
- Posts: 627
- Joined: Wed Apr 24, 2013 4:53 pm
- Contact:
Re: play audiofile from web server
I'm not sure that is the case, at least not with sound files on Android.
I've used:
Code: Select all
play theFile