Page 1 of 2

Problem with Player & Stream Audio.

Posted: Thu Mar 27, 2014 8:02 am
by GerardoAgraz
Hi, Im trying to develop a little app for Mac OS X, that App just have a player control & two buttons, the idea is play an audio stream but I have a very mysterious problem. :shock:

Description of problem:

Scenario 1: I put the player control on the card, in the source (filename) fill with the url h t t p:// server/ file.m3u
In run mode press play on the player control & works perfect.

Scenario 2: I put a button and use this script to play the sound:
set the filename of player "Player" to "h t t p:// server/ file.m3u"
start player "Player" & works perfect, I can play the stream.

The problem begin when I save the changes or create the standalone file, in this moment some fail and don't play the audio stream.
I can play again the audio stream only if delete the player and put a new one. But if I save the changes or create the standalone file, fail again.

Any Idea?

*** Update ***
If I put in properties source the url again, and in run mode press play in the player control it works.... :?: :?: :?:

Re: Problem with Player & Stream Audio.

Posted: Thu Mar 27, 2014 1:36 pm
by Klaus
Hola Gerardo,

1. welcome to the forum! :D

2. No idea, that may be a QuickTIme problem.

Try this:
Set the filename(s) to empty on "opencard" and only
use a script to set the filename.

Also, set the filename to empty and wait a couple of millisecs
before setting the filename again to any other URL.

At least worth a try :D


Best

Klaus

Re: Problem with Player & Stream Audio.

Posted: Thu Mar 27, 2014 5:49 pm
by GerardoAgraz
Exists other way to play a stream on LiveCode without QT ?

Re: Problem with Player & Stream Audio.

Posted: Thu Mar 27, 2014 6:06 pm
by GerardoAgraz
The only way to make it works are creating and destroying the object at runtime:

if exists (player "Player") then
delete player "Player"
end if
create invisible player "Player"
set the filename of player "Player" to "h t t p:// server /file.m3u"
start player "Player"

But in the activity monitor the app are consuming 43% of CPU :shock:

I think this is insane, just one button and 6 lines of code 43% of CPU

Re: Problem with Player & Stream Audio.

Posted: Wed Aug 05, 2015 12:47 pm
by Ultravibe
i have the same problem. I created three buttons (Play,Stop and Choose)
Play button:

Code: Select all

on mouseUp
start player "Player"
end mouseUp
Stop button:

Code: Select all

on mouseUp
stop player "Player"
end mouseUp
Choose button opens a standard dialogue to choose the file and then put the result into "fileName" property of player
The problem is: After start playing my stack doesn't responds on any actions: pushing buttons or something other. It looks like CPU overload, but in Activity Monitor i have just 6.2% User CPU load.
Why does the app not responds during play video and what am i gonna do?

Re: Problem with Player & Stream Audio.

Posted: Wed Aug 05, 2015 12:53 pm
by Klaus
What platform?
What version of LC?
What version of QuickTIme, if at all? 8)

Re: Problem with Player & Stream Audio.

Posted: Wed Aug 05, 2015 1:08 pm
by Ultravibe
Mac OS X 10.7.5. LiveCode 7.1.0
Quicktime Version 10.1 (501.29)

Re: Problem with Player & Stream Audio.

Posted: Wed Aug 05, 2015 1:09 pm
by Ultravibe
may be i should try the same app on Windows?

Re: Problem with Player & Stream Audio.

Posted: Wed Aug 05, 2015 1:17 pm
by Klaus
Livecode >= 7 will automatically > set the DONTUSEQT to TRUE because it will use the new AVFoundation framework.
But I'm not sure if AVF is already built into OS X 10.7.5?

Did you set DONTUSEQT back to FALSE maybe on PREOPENSTACK?

And yes, checking the same app in WIndows might help...

Re: Problem with Player & Stream Audio.

Posted: Wed Aug 05, 2015 1:36 pm
by Ultravibe
in Windows it doesn't play at all. I'll try to set dontuseqt to false

Re: Problem with Player & Stream Audio.

Posted: Wed Aug 05, 2015 1:40 pm
by Ultravibe
Unfortunately, nothing changes(((( when i set dontuseqt to false

Re: Problem with Player & Stream Audio.

Posted: Wed Aug 05, 2015 1:47 pm
by Klaus
Is QuickTIme installed on the Win machine?

I forgot that you are using LC 7.1, new in this version: "dontuseqt" is a PROPERTY of a player object
and can be set for each player individually, means one player can use QT and another one the newer AVFoundation
OS X only, of course.

Did you set this for your player?

Re: Problem with Player & Stream Audio.

Posted: Wed Aug 05, 2015 2:05 pm
by Ultravibe
DONTUSEQT isn't a property of player!!!!!!

Re: Problem with Player & Stream Audio.

Posted: Wed Aug 05, 2015 2:17 pm
by Klaus
Sorry, did not work with 7.1 yet, since this is an early Developer Release!

I may have misunderstood this, but I could have sworn I have read this somewhere
on the mailing list or Release notes. :oops:

Re: Problem with Player & Stream Audio.

Posted: Wed Aug 05, 2015 2:23 pm
by Ultravibe
i've tried this on practice and find out that Player doesn't have such property!!!!