Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

LastQuickTimeErrorMBS as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method QuickTime MBS QuickTime Plugin 3.2 Yes Yes No No No
Function: Asks QuickTime for the last error code.
Notes:
Returns the contents of the current error value and resets the current error value to 0.
If QuickTime is not available, the function returns -1.

Feedback, Comments & Corrections

OpenMovieFromMemoryBlockMBS(mem as memoryblock, offset as Integer, size as Integer, name as string, mime as string) as movie
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method QuickTime MBS QuickTime Plugin Yes Yes No No No
Function: Opens a file from a memoryblock.
Notes:
A Movie (loaded from file or from a network) is opened as a movie.
The name (filename) and the mime code is used to tell QuickTime what Movieimporter to use. And this function will fail most of the time if there is no name and no mime type.
Name and Mime may be "".
On any error returns nil.
If the used data string is destroyed, the movie object goes invalid and using the movie after this will certainly crash your application. So store a memoryblock reference somewhere (window or module) to keep it alive.
This function does not work in Cocoa due to a bug in Real Studio. This bug has been fixed in Xojo 2013r1.

Feedback, Comments & Corrections

OpenMovieFromStringMBS(data as string, name as string, mime as string) as movie
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method QuickTime MBS QuickTime Plugin Yes Yes No No No
Function: Opens a file from a memoryblock.
Example:
dim data as string // global. For example in the window

dim f as FolderItem = GetFolderItem("test.mov")
dim b as BinaryStream = f.OpenAsBinaryFile(False)

if b=nil then
MsgBox "Failed to open movie file"
Return
end if

data = b.Read(b.Length) // data must exists as long as movie exists!

if lenb(data)=0 then
MsgBox "Failed to read movie file"
Return
end if

dim m as movie = OpenMovieFromStringMBS(data,"test.mov","")

if m=nil then
MsgBox "Failed to load movie"
Return
end if

MoviePlayer1.Movie=m
Notes:
A Movie (loaded from file or from a network) is opened as a movie.
The name (filename) and the mime code is used to tell QuickTime what Movieimporter to use. And this function will fail most of the time if there is no name and no mime type.
Name and Mime may be "".
On any error returns nil.
If the used data string is destroyed, the movie object goes invalid and using the movie after this will certainly crash your application. So store a string reference somewhere (window or module) to keep it alive.

On Windows you need to set movieplayer to QuickTime before you assign this movie so Real Studio runtime uses QuickTime for playback. Trying Windows Media Player will fail.
This function does not work in Cocoa due to a bug in Real Studio. This bug has been fixed in Xojo 2013r1.

Some examples using this method:

Feedback, Comments & Corrections

OpenMovieHandleMBS(moviehandle as Integer) as movie
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method QuickTime MBS QuickTime Plugin 4.2 Yes Yes No No No
Function: Creates a movie object from a handle.
Notes:
Don't destroy the handle after using this function.
Returns nil on any error.
This function does not work in Cocoa due to a bug in Real Studio. This bug has been fixed in Xojo 2013r1.

Feedback, Comments & Corrections

OpenMovieURLMBS(url as string, flags as Integer) as movie
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method QuickTime MBS QuickTime Plugin 5.4 Yes Yes No No No
Function: Opens a movie from an URL.
Example:
dim m as movie
dim n,i as Integer

const newMovieAsyncOK=256 // we are trying async loading
const url="rtsp://a2047.v1411b.c1411.g.vq.akamaistream.net/5/2047/1411/2_h264_650/1a1a1ae454c430950065de4cbb2f94c226950c7ae655b61a48a91475e243acda3dac194879adde0f/oct_event_2_h264_650.mov"
// Apple Special Event Stream URL from 12th October 2005. Change if needed.

i=ticks
for n=1 to 10
m=OpenMovieURLMBS(url, newMovieAsyncOK)
m=nil
next
i=ticks-i
MsgBox str(i)

i=ticks
for n=1 to 10
m=OpenURLMovie(url)
m=nil
next
i=ticks-i
MsgBox str(i)
Notes:
URL must be ASCII or UTF-8 encoded.

Possible flags value:

newMovieActive= 1
newMovieDontResolveDataRefs= 2
newMovieDontAskUnresolvedDataRefs= 4
newMovieDontAutoAlternates= 8
newMovieDontUpdateForeBackPointers= 16
newMovieDontAutoUpdateClock= 32
newMovieAsyncOK= 256
newMovieIdleImportOK= 1024
newMovieDontInteractWithUser= 2048

Default is to use newMovieActive and newMovieDontResolveDataRefs.

Please check LoadStateMBS for the status of the movie if you used newMovieAsyncOK.

Returns nil on any error or on Linux.
This function does not work in Cocoa due to a bug in Real Studio. This bug has been fixed in Xojo 2013r1.

Feedback, Comments & Corrections

OpenURLMovieMBS(url as string) as movie
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method QuickTime MBS QuickTime Plugin 9.5 Yes Yes No No No
Function: Opens a movie with the given URL.
Example:
dim m as movie
dim s as string = "http://www.monkeybreadsoftware.de/realbasic/movies/AppleScript-iPhone.m4v"

m=OpenURLMovieMBS(s)

MoviePlayer1.movie=m
Notes:
The URL must be in plain ASCII text encoding.
Returns nil on any error.

Feedback, Comments & Corrections

QTRegisterAccessKeyMBS(accessKeyType as string, flags as Integer, accessKey as string) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method QuickTime MBS QuickTime Plugin 6.0 Yes Yes No No No
Function: Registers an access key.
Notes:
accessKeyType: The access key type of the key to be registered.
flags: Flags that specify the operation of this function. To register a system access key, set the kAccessKeySystemFlag flag (see below). To register an application access key, set this parameter to 0.
accessKey: A handle to the key to be registered.

Returns an error code (-1 if function is missing).

Most access keys are binary strings.

const kAccessKeySystemFlag=1

accessKeyType and accessKey must have the needed text encoding.

Feedback, Comments & Corrections

QTUnregisterAccessKeyMBS(accessKeyType as string, flags as Integer, accessKey as string) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method QuickTime MBS QuickTime Plugin 6.0 Yes Yes No No No
Function: Removes a previously registered access key.
Notes:
accessKeyType: The access key type of the key to be removed.
flags: Flags (see below) that specify the operation of this function. To remove a system access key, set the kAccessKeySystemFlag flag. To remove an application access key, set this parameter to 0.
accessKey: The key to be removed.

Returns an error code (-1 if function is missing).

Most access keys are binary strings.

const kAccessKeySystemFlag=1

accessKeyType and accessKey must have the needed text encoding.

Feedback, Comments & Corrections

QuickTimeGetUsersConnectionSpeedMBS as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method QuickTime MBS QuickTime Plugin Yes Yes No No No
Function: Returns a code for the speed of the line.
Example:
msgbox str(QuickTimeGetUsersConnectionSpeedMBS)
Notes:
You get these values:

140014k Modem
280028k Modem
5600ISDN
11200Dual ISDN
25600DSL with 256 KBit/s
38400DSL with 384 KBit/s
51200DSL with 512 KBit/s
76800DSL with 768 KBit/s
100000DSL with 1 MBit/s
150000T1
&h7FFFFFFFInfiniteRate

if no rate is set the function returns 2800 for an 28k Modem.

Feedback, Comments & Corrections

QuickTimePollMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method QuickTime MBS QuickTime Plugin Yes Yes No No No
Function: Gives CPU time to QuickTime to update movies.
Notes:
Some people cry about missing performance on playing movies in RB. This function may help there. if you use threads it may be good to call it from time to time.

Suggested timer period setting is 50 ms.

Calls internally MovieTasks(NULL).

Some examples using this method:

Feedback, Comments & Corrections

QuickTimePresentMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Quicktime MBS QuickTime Plugin Yes Yes No Yes No
Function: Returns true if QuickTime is present.

Some examples using this method:

Feedback, Comments & Corrections

QuickTimeSetUsersConnectionSpeedMBS(newspeed as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method QuickTime MBS QuickTime Plugin Yes Yes No No No
Function: Sets the connection speed.
Notes:
See QuickTimeGetUsersConnectionSpeed for the rate codes.
This function returns true if it is successfull.

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS QuickTime Plugin.




Links
MBS Xojo PDF Plugins