MPEG ADVANCE XTRA HELP: MEMBER FUNCTIONS | ||
Mpeg Advance Xtra provides several functions that can be called from Lingo or JavaScript syntax scripts to retrieve information about the Media linked to the members.
member(x).addCuePoint( cuepointtime, cuepointname) - This function can be used to create a new cue point from scripting. Cue points are automatically sorted. Example: member("mpegfile").addcuepoint(10500, "NewCue")
member(x).removeCuePoint(cuepointindex) - This function can be used to remove a cue point. You should supply the index of the cue point to be removed. Example: member(x).removecuepoint(2)
member(x).canPlayVideo() - Returns 1 (TRUE) or 0 (FALSE). Can be used to determine if a given member can be played in the system, and it is useful to test for system capabilities if you are planning for example to play MPEG2 or MPEG4 content. IMPORTANT: on the Macintosh the function member(x).quicktimeversion() should be used to test for the capability to play MPEG4 videos. Attempting to play or query some MPEG4 files when Quicktime 5 is installed can produce a type 10 error. Lingo example: member(1).canPlayVideo() if the result=0 then alert("Member 1 can not be played") else --nothing end if
member(x).canImageOffScreen() - Returns 1 (TRUE) or 0 (FALSE). Can be used to determine if non direct-to-stage playback and access to the image of sprite object is possible in the system. Older versions of the DirectShow engine (released before DirectX 7.1) can play MPEG1 files, but do not allow access to the data necessary for offscreen imaging. In this case the MPEG file will still play correctly in DTS mode, which is set automatically by the Xtra. Lingo example: member(1).canImageOffScreen() if the result=0 then alert("DTS playback is disabled for member 1") else --nothing end if
member(x).quicktimeversion() - This function can be used to test for the presence of Quicktime 6 on the Macintosh, and enable playback of MPEG4 files. Possible return values are the version of Quicktime installed (3.01 or 6.02 for example) or FALSE (0). On Windows the return value is always 0. Lingo example: put member(2).quicktimeversion() -- 6.00
member(x).scanFile() - This function can be used to extract the correct duration and dimensions of a video file when the linked media is changed via scripting. The file is queried and the castmember properties are updated automatically. This function is usually not necessary for the typical operation of the Xtra. Example: member(2).scanfile()
member(x).register(registrationnumber) -This function can be used in Projectors to register the Xtra at runtime, and allow developers to save linked casts. It is not necessary for the normal operation of the Xtra. Example: member("mpegfile").register("SERIALNUMBERHERE")
|