REALbasic – MoviePlayer Control line

MoviePlayer Control available in REALbasic displays a control for playing Quicktime and Windows Media Player movies. It can be also used as a MP3 player or PDF viewer. Let’s look into some REALbasic MoviePlayer Control examples.

MoviePlayer Control info

Windows uses the Windows Movie Player to play movies and Mac OS uses the QuickTime player. On Linux, the MoviePlayer uses GStreamer by default (it requires version 0,10+) and uses Xine if GStreamer is not available.

The Controller property dictates how the movie controls (if any) will be displayed. Passing 0 (zero) means that there will be no user controls available. Passing 1 means that a movie icon or badge will be displayed in the lower left corner of the movie area instead of the controller. When this badge is clicked by the user, the badge disappears and the regular movie controls appear at the bottom of the movie frame. Passing 2 displays the regular movie controls.

Checking if QuickTime is installed in system

Here you can find how to check if QuickTime is installed in system.

1
2
3
if System.QuickTime.Installed then
MsgBox "QuickTime detected!"
end if

Load a movie or MP3 to REALbasic MoviePlayer Control

This example loads a movie called REALbasicMovie.mp4 from the current directory into MoviePlayer1 and plays it.

1
2
3
4
5
6
Dim f As FolderItem
 
f = GetFolderItem("REALbasicMovie.avi")
 
MoviePlayer1.Movie = f.OpenAsMovie
MoviePlayer1.Play

Get current MoviePlayer position

Display the current video or audio position from MoviePlayer Control.

1
2
3
Dim p As Double //Double is a number that can contain a decimal value, i.e., a real number.
 
p = MoviePlayer1.MovieController.Controls.CurrentPosition

Author: Jakub Pawlak

I'm interested in all. Currently working on the development of TUTSPOLIS and I hope that in near feature the project will be successful.

6 Responses to “REALbasic – MoviePlayer Control”

  1. So wait, the MoviePlayer control doesn’t work with Linux?

  2. Jakub Pawlak says:

    If you like to use MoviePlayer Control on Linux you must install GStreamer or Xine multimedia framework. Without them the MoviePlayer Control doesn’t work.

  3. Eric says:

    So how would you setup the GetFolderItem to pickup a file on a samba share.

  4. John B says:

    How would you ask the player to play a live mp3 stream or video??

    Thanks\John

  5. Jakub Pawlak says:

    Hello,

    solution for you John B :)

    Dim s As Sound
    Dim f As FolderItem

    f = New FolderItem(“realbasic.mp3″)

    s = f.OpenAsSound

    s.Play

  6. Jakub Pawlak says:

    Dim MP3 As New FileType

    MP3.Name = “MP3 files”
    MP3.Extensions = “.mp3″

    Dim File1 As FolderItem = GetOpenFolderItem(MP3Types)

    if File1 nil then
    MoviePlayer1.Movie = File1.OpenAsMovie
    end if

    MoviePlayer1.Play

Leave a Reply

Copyrights (c) TUTSPOLIS | Powered by Wordpress MU | Inspired at Elegant Themes designed by qbap (HTML5 & CSS3)