Page 1 of 1

Video don't run on iPhone

Posted: Sat Jul 23, 2011 12:07 am
by ueliweb
Hei
as I not found an answer in the forum that solves my case post a new topic.
Feel free also to link another topic that could help.

I tried to play a movie in a player object the movie should be loaded from the Applications Subfolder so the file path in the end is: "theApplicationsFolder/Library/Application Support/Videos/fi_SVK/A.mp4"

if I use specialFolderPath("engine") and play with with "play videoClip" then the video runs in the native movie player but I never get the movie running in the object "player" (in the code as comment"
No matter where I save my video. in the Apps root ("engine"), in the "Documents" or the "Library"
-> "play videoClip" as full screen works but the player "MoviePlayer" shows nothing.

what I do wrong?

Code: Select all

on playVideofromPath tFileType, tLetter, tSpezFolderType 
   put specialFolderPath(tSpezFolderType) & "/Application Support/Videos/fi_SVK/" & tLetter & tFileType  into tVideoFile
   set the filename of player "MoviePlayer" of this card to tVideoFile
   play videoClip tVideoFile
   --   play player "MoviePlayer"
   answer "the filename of player:" && the filename of player "MoviePlayer" & return & return & \
         "tVideoFile:" && tVideoFile
end playVideofromPath
       
on playVideofromEnginePath tFileType, tLetter 
   put specialFolderPath("engine") & slash & tLetter & tFileType  into tVideoFile
   set the filename of player "MoviePlayer" of this card to tVideoFile
   play videoClip tVideoFile
   --   play player "MoviePlayer"
   answer "the filename of player:" && the filename of player "MoviePlayer"
end playVideofromEnginePath

Re: Video don't run on iPhone

Posted: Sat Jul 23, 2011 11:28 am
by Klaus
Hi ueli,

looks like you are mixing the (desktop) player object, which does not work on iOS,
with the native iOS "MoviePlayer", which needs to be created "on the fly" since this
does not work on the desktop/IDE. Unfortunately both are named "player"!

Check this in the dictionary: iPhoneControlCreate...

And check the "iOS Release Notes" via menu: Help!
Page 46 of the PDF in the lastest LiveCode 4.6.3 release: Player control – MPMoviePlayerController


Best

Klaus

Re: Video don't run on iPhone

Posted: Sat Jul 23, 2011 11:48 am
by Dixie
Hi...

If you want to play a movie on the desktop, then 'yes' use a player object, but if you want to play a movie in the iphone/ipad simulator then you will have to use the MPMoviePlayerController -Player Control...

Code: Select all

on preOpenstack
   if environment() is not "mobile" then
      set itemDel to "/" 
      set the defaultfolder to item 1 to -2 of (the effective fileName of this stack)
      set the loc of this stack to screenLoc()
      
      set the filename of player 1 to "./Swings.m4v"
      set the visible of player 1 to true
   end if
   
   if environment() is "mobile" then
      set the visible of player 1 to false
      if "ioscontrol" is among the lines of iphoneControls() then controlDelete
      
      iphoneControlCreate "player", "ioscontrol"
      iphoneControlSet "ioscontrol", "filename", specialFolderPath("engine") & "/Swings.m4v"
      iphoneControlSet "ioscontrol", "preserveAspect", true
      iphoneControlSet "ioscontrol", "showController", true
      iphoneControlSet "ioscontrol", "visible", true
      iphoneControlSet "ioscontrol", "fullscreen", true
      iphoneControlSet "ioscontrol", "rect", "188,124,832,624"
      iphoneControlDo "ioscontrol", "play"
   end if
end preOpenstack

on closeCard
   if environment() is not "mobile" then
      controlDelete
   end if
end closeCard

on playerFinished
   iphoneControlSet "ioscontrol", "fullscreen", false
end playerFinished

on controlDelete
   iphoneControlDelete "ioscontrol"
end controlDelete
The above script shows you a movie playing on the desktop and it will also play the movie in the simulator... The stack & movie is a little large to include as an attachment but if you mail me dixonja@hotmail.co.uk off-list I can send you the stack & movie as an archive...

be well

Dixie

Re: Video don't run on iPhone

Posted: Sat Jul 23, 2011 12:26 pm
by ueliweb
Hei Dixi

thanks for the help!

That means I need to make separate movie programming for each plattform?
Android, revServer, Web, Windows Mobile, ...?

Mac,Win, Linux should be the same as the dictionary suggest.

Re: Video don't run on iPhone

Posted: Sat Jul 23, 2011 1:47 pm
by Klaus
Hi ueli,
ueliweb wrote:That means I need to make separate movie programming for each plattform?
Android, revServer, Web, Windows Mobile, ...?
Yes, but revServer does NOT support any graphic representation!
This is a PHP like server scripting thing!
ueliweb wrote:Mac,Win, Linux should be the same as the dictionary suggest.
Yes.


Best

Klaus