Previous Table of Contents Next


Oracle Video Custom Control

Don’t throw away your Visual Basic. Because the Oracle Corporation realized that many users would want to build applications with video without using Oracle’s front-end tools, Oracle has invested a great deal of money to make the Oracle Video Server an open server. It is realized that many video applications, even if they utilize the Oracle Video Server, will utilize different tools like Visual Basic in the building of the client front end.

Since the client front-end might be written in Visual Basic, Oracle has come up with a series of Objects called Custom Controls that can be used by Visual Basic or even the virtually non-existent Oracle Power Objects package.

Here are some of the properties and methods you can use with the Oracle Video Custom Control. Remember that this offering can be plugged into Visual Basic just like other third-party tools that enhance the functionality of VB to perform special tasks.

  BorderStyle This property can be set to 0 (No Border) or 1 (Border) to define the video screen within the application.
  ClipboardFrameFormat This specifies the file format used when copying a frame, it is a Boolean value or either 0 or 1:
1 BMP file
0 Device Independent Bitmap
  HasVideo This attribute is used to see if the Oracle Video Custom Control has a video prepared or not.
0 No video prepared
Non-zero Video is prepared

Here would be a sample piece of code using this control:

Private Sub GetReadyToPlay()

    myvideo.ImportStreamAs



    If myvideo.HasVideo = true then

rem we have video

    Else

rem we don’t have video

    End If

End Sub


Notice that true/false behave in a similar way to the C language in that true is any non-zero number and false must be zero.
  ImportFileSpec This attribute is set with the proper filename and path to either the Oracle Media Data Store or a valid operating system-dependent filename. This attribute must be used before Prepare or Play to open the video file for usage.
  LengthFrames This is an important attribute because it gives the length in frames of a piece of video. If it returns a zero, it means that no video is prepared.
  LengthTime This attribute gives the length of a video stream in milliseconds. It, too, must be called after the video is prepared or it will return a zero.
  PlayVolume This attribute allows you to set the volume between 0 and 9, where 0 is no sound and 9 is the loudest. The attribute is read/write because the media author may need to adjust this during a presentation.
  CopyFrame This method only works with certain drivers because it is designed to copy a frame of video to the Microsoft Clipboard. Here is a sample call using this function:

Private Sub UserClick()

    myvideo.CopyFrame

    MyPicture.Picture = Clipboard.GetData()

End Sub



ImportFileAs

  ImportFileSpec This is a very important property that will display for the user a list of videos from which he or she can choose. ImportFileAs sets the ImportFileSpec of the user’s choice and performs a Prepare, which links the client to video file.
Here is a code stub using this powerful property:

Private Sub UserClick()

    myvideo.ImportFileAs

    myvideo.play

End Sub


With these two lines of code a user can both pick an available video from a list and then watch it begin to play.
  ImportSreamAs If you are indeed using the Oracle Media Server and not just a set of files to store your video data, call this function. It also sets the ImportFileSpec and performs a Prepare. You use this method when receiving data from the Oracle Media Server. The ImportFileSpec is used to retrieve a native video file outside of Oracle, like an MPEG file.
  Pause This is a simple method to use when you need to, or the user wants to, pause a video clip. It is also tricky because while the video is paused you can alter PositionFrames and/or PositionTime, which will change the place were the video will start up again after it has been paused. One simple call of the Pause method will pause your video:

Private Sub UserPauseClick()

    myvideo.Pause()

End Sub

  Play This method simply plays video starting from the current position. If you do not issue a Prepare before calling Play, Play will do an implicit Prepare, but it will cause the video stream to be slower.
Here is a code snippet where you give the user a choice of video and then play it for him or her:

Private Sub UserClicksOnSuperBowl()

    myvideo.ImportFileSpec = superbowl.mpi

    myvideo.Prepare

    myvideo.Play

End Sub

  PositionFrames This attribute displays the current position of the playing frames. The answer is given in frames.
  PositionTime This attribute can be used to display the current position in a video file. By resetting the PositionTime, you can jump forward and backward in your video presentations.
  ShowControls This is a Boolean that sets the other controls as either visible or not visible.
  ShowPosition This determines if the position of a video’s progress is displayed onscreen or not.
  ShowVideoInfo This determines if video information, like the format, time, and frame, need to be displayed to the user.
  ShowVolume This determines if the volume control is hidden from the user or not; it is also a Boolean value of true or false.
  Video Format This displays the current format of the Prepared video. For instance if the video was in MPEG format this attribute would display MPG.
  Prepare This method needs to be called to set up a new link between a video file or MDS area and the client machine. In the earlier example, you call Prepare before you call Play because Prepare sets up a link so you can play video.
  Release This method is called when your application is finished with the video link between the client machine and either a file or the Oracle MDS. It frees up the resources used in the Prepare statement.
  Stop This is called to stop the current stream of video. Here is a code sample that uses Stop and Release when a user presses an exit key:

Private Sub UserClicksOnExit()

    myvideo.Stop

    myvideo.Release

End Sub


Previous Table of Contents Next
Используются технологии uCoz