LC 5.5 accepts, LC ≥7.0.5 denies

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
pderks
Posts: 58
Joined: Sat May 14, 2011 4:25 pm

LC 5.5 accepts, LC ≥7.0.5 denies

Post by pderks » Tue Jul 07, 2015 12:09 am

Hi,

my variable 'PlayerFrame' contains the name of a a field that marks the boundary of the player.

Code: Select all

on PDF_Show
…
   pda_Media_ScaleToFrame "player",PlayerName,PlayerFrame,FilePath,false,true
…
end PDF_Show
---
on pda_Media_ScaleToFrame MediaControlType,MediaControlName,MediaFrameField,MediaFileName,ShowContr_F,LockLoc_F
   do "put" &&  q("0,0,") & " & the FormattedWidth of" && MediaControlType && q(MediaControlName) && "&" && q( ",") ¬
   && "& the FormattedHeight of" && MediaControlType && q(MediaControlName) && "into" && MediaRect
…
end pda_Media_ScaleToFrame
LiveCode 5.5 states "0,0,400,300" as value of the variable 'MediaRect‘, LiveCode ≥ 7.0.5 states "0,0,0,0".

According to the dictionary 'FormattedWidth' and 'FormattedHeight' have not been changed since 1.0.

Thanks

Peter

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: LC 5.5 accepts, LC ≥7.0.5 denies

Post by Klaus » Tue Jul 07, 2015 2:19 pm

Hi Peter,

in LC >= 6.x "the donuseqt" is set to TRUE by default!

LC now uses the MacOS X AVFoundation Framework for multimedia playback
and only QuickTime is able to display PDF files in a player object.

So setting "the dontuseqt" to false should fix this.

In LC 7.06 (or 7.07?) "the donuseqt" will be a property of a player object.
Means you can have QuickTime in one player and AVFoundation in others.

Hint:
I would put the long id of the object into a variable, this way you do not need
to mess around with DO!

Code: Select all

on pda_Media_ScaleToFrame tLongObjectID,MediaFrameField,MediaFileName,ShowContr_F,LockLoc_F
  put "0,0," & the formattedwidth of tLongObjectID & "," & the formattedheight of tLongPbjectID into Mediarect
  …
end pda_Media_ScaleToFrame
You get the picture :D


Best

Klaus

pderks
Posts: 58
Joined: Sat May 14, 2011 4:25 pm

Re: LC 5.5 accepts, LC ≥7.0.5 denies

Post by pderks » Tue Jul 07, 2015 8:27 pm

Hi, Klaus,

thank you for your lines. But sad to say, they did not help.

Quickly I have put a button, a field and a player into an artless stack. I dragged a pdf-Path into the field and click this button:

Code: Select all

on mouseUp
   set the DontUseQt to false
   create player "MyPlayer"
   set the Rect of player "MyPlayer" to "140,170,470,699"
   set the FileName of player "MyPlayer" to fld "MyField"
   set the ShowController of player "MyPlayer" to true
end mouseUp
LiveCode 5.5 √
LiveCode 6.5 √
LiveCode 6.7.1 —
LiveCode 6.7.4 —
LiveCode 7.0.6 —

Thanks

Peter

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: LC 5.5 accepts, LC ≥7.0.5 denies

Post by Klaus » Tue Jul 07, 2015 11:18 pm

Hi Peter,

I'm not sure you can set this property "on the fly"!?
Try to "set the DontUseQt to false" in the "preopenstack" script.


Best

Klaus

pderks
Posts: 58
Joined: Sat May 14, 2011 4:25 pm

Re: LC 5.5 accepts, LC ≥7.0.5 denies

Post by pderks » Wed Jul 08, 2015 11:46 am

Hi, Klaus,
Try to "set the DontUseQt to false" in the "preopenstack" script.
I would have preferred to say "Thank you, that's it …". So I say "Thank you".

The recent versions of LiveCode seem to have lost their player's ability to display files of type PDF.

Regards

Peter

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: LC 5.5 accepts, LC ≥7.0.5 denies

Post by Klaus » Wed Jul 08, 2015 12:50 pm

Hi Peter,
pderks wrote:
Try to "set the DontUseQt to false" in the "preopenstack" script.
I would have preferred to say "Thank you, that's it …". So I say "Thank you".
does that mean it doesn't work at all?
pderks wrote:The recent versions of LiveCode seem to have lost their player's ability to display files of type PDF.
That is not correct :D
Only players that do NOT use QuickTime cannot display PDF files!

Can't you use a browser object to display a PDF?
That will work right out of the box, at least on the Mac.


Best

Klaus

Post Reply