Android mobile audio player

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Android mobile audio player

Richard Gaskin via use-livecode
I'm unable to get the native player to work on Android, using scripts
that did work previously. I'm streaming mp3 files from a server, and
they work fine on desktop so I know the file is being sent. I've also
tried opening a copy from Dropbox in three different audio players on
Android and they all play too, so the file format is okay.

The script I'm using, which worked previously:

command createMobileAudioPlayer pURL, pPlayerName
   -- pURL = remote video or audio file
   -- pPlayerName = name of player to create
   mobileControlCreate "player",pPlayerName
   mobileControlSet pPlayerName, "visible", true
   mobileControlSet pPlayerName, "rect", getPlayerRect() -- returns a rect
   mobileControlSet pPlayerName, "showController", true
   mobileControlSet pPlayerName, "filename", pURL
   if pURL begins with "http" then
     showBusyIndicator true -- show spinner until duration is available
   end if
end createMobileAudioPlayer

on playerPropertyAvailable tProperty -- sent when enough has content is
loaded
   if tProperty is "duration" then
     showBusyIndicator false -- Remove spinner and start playing
     setMobileAudioPlayer "listen", "play" -- handles playback
   end if
end playerPropertyAvailable

The control does get created, but shows a duration of zero. The
playerPropertyAvailable message never arrives, so the player doesn't
start. I've tried starting the player directly from the
"createMobileAudioPlayer" handler but that also fails.

I'd like to verify that audio is no longer working before I submit a
report.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Android mobile audio player

Richard Gaskin via use-livecode
Hello Jacque,

What Android version does your device run? A rough guess is that the
problem is security/permissions related. On Android 9+ there is something
equivalent to iOS ATS that blocks connections that do not comply with some
security standards. You can workaround this by adding a suitable entry to
the Android manifest.

See "Option 2" in this bug report:

https://quality.livecode.com/show_bug.cgi?id=22400

Kind regards,
Panos
--

On Mon, 4 Nov 2019 at 23:40, J. Landman Gay via use-livecode <
[hidden email]> wrote:

> I'm unable to get the native player to work on Android, using scripts
> that did work previously. I'm streaming mp3 files from a server, and
> they work fine on desktop so I know the file is being sent. I've also
> tried opening a copy from Dropbox in three different audio players on
> Android and they all play too, so the file format is okay.
>
> The script I'm using, which worked previously:
>
> command createMobileAudioPlayer pURL, pPlayerName
>    -- pURL = remote video or audio file
>    -- pPlayerName = name of player to create
>    mobileControlCreate "player",pPlayerName
>    mobileControlSet pPlayerName, "visible", true
>    mobileControlSet pPlayerName, "rect", getPlayerRect() -- returns a rect
>    mobileControlSet pPlayerName, "showController", true
>    mobileControlSet pPlayerName, "filename", pURL
>    if pURL begins with "http" then
>      showBusyIndicator true -- show spinner until duration is available
>    end if
> end createMobileAudioPlayer
>
> on playerPropertyAvailable tProperty -- sent when enough has content is
> loaded
>    if tProperty is "duration" then
>      showBusyIndicator false -- Remove spinner and start playing
>      setMobileAudioPlayer "listen", "play" -- handles playback
>    end if
> end playerPropertyAvailable
>
> The control does get created, but shows a duration of zero. The
> playerPropertyAvailable message never arrives, so the player doesn't
> start. I've tried starting the player directly from the
> "createMobileAudioPlayer" handler but that also fails.
>
> I'd like to verify that audio is no longer working before I submit a
> report.
>
> --
> Jacqueline Landman Gay         |     [hidden email]
> HyperActive Software           |     http://www.hyperactivesw.com
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode