Oracle Video Client Software Guide
Release 2.1.8
A42334_4

Library

Product

Contents

Index


Prev Next

Chapter 5
Working with Oracle Forms

This chapter is intended for developers who want to use the Oracle Video Custom Control OCX (OLE Custom Extension) to add video capabilities to their Oracle Forms applications.

Although there are no functional differences in the Oracle Video Custom Control between Oracle Forms and Oracle Power Objects (or Microsoft Visual Basic), there are some substantial differences in how to load and use the Oracle Video Custom Control from Oracle Forms.

For information on the methods, properties, and events provided by the Oracle Video Custom Control, see Chapter 4, Oracle Video Custom Control.

This chapter contains these sections:

To use the Oracle Video Custom Control with Oracle Forms, you need Oracle Forms v4.5.7, which is a component of Oracle Developer/2000, release 1.3.

A Simple Application

This example uses the Oracle Video Custom Control to create a simple application which enables users to view, select, and play videos from a local hard disk or the Oracle Video Server. To see this same application created in Oracle Power Objects and Visual Basic, see Chapter 3, Oracle Video Custom Control.

Loading the Oracle Video Custom Control

Note

When you initially create the Oracle Video Custom Control object, you will not be able to modify the properties of the object until you deselect it (by clicking anywhere else on the screen) and then re-select it.

  1. Open the Forms Designer and go to the Layout Editor in the Tools menu.
  2. Create the OLE object:
    1. Click on the OLE2 object icon in the Tool Palette.
    2. Position the cursor on the grid, then click and drag to create a box for the object.
    3. Right-click on the box and choose Insert Object. The Insert Object Dialog box appears.
    4. Scroll down the Object Type list and choose Oracle Video Control. Click OK.
    5. Expand the size of the box as necessary to see all the buttons.
    6. Double-click on the OCX object to display its properties.
    7. Under the Functional section, change OLE In-place Activation setting to True.
    8. Before closing the properties box, change the Name to "MY_VIDEO". Click on a setting other than Name to implement the name you entered.
    9. Close the Properties Dialog Box.

Creating the Application

  1. Create a button to choose videos from the local hard disk.
    This button uses the ImportFileAs method to display videos available on the local hard disk or CD-ROM.
    1. Click on the Push Button icon in the Tool Palette.
    2. Click on the grid to place the button.
    3. Double-click on the button to display its properties.
    4. Under the Functional section, change the Label property to Local Videos.
    5. Close the Properties Dialog Box.
  2. Create a trigger for the button:
    1. With the button selected in the Layout Editor, choose PL/SQL Editor from the Tools menu.
    2. Choose New.
    3. Select WHEN-BUTTON-PRESSED as the type of trigger and click OK.
    4. Enter the following text:
    5. declare
      video_obj ole2.obj_type;
      begin
      video_obj := forms_ole.get_interface_pointer (`MY_VIDEO');ole2.invoke(video_obj,`ImportFileAs');
      end;
    6. Choose Compile.
    7. Choose Close.
  3. Create the button to choose a video from the server:
    1. Click on the Push Button icon in the Tool Palette.
    2. Click on the grid to place the button.
    3. Double-click on the button to display its properties.
    4. Under the Functional section, change the Label property to Server Videos.
    5. Close the Properties Dialog Box.
  4. Create a trigger for the button:
    1. With the button selected in the Layout Editor, choose PL/SQL Editor from the Tools menu.
    2. Choose New.
    3. Select WHEN-BUTTON-PRESSED as the type of trigger and click OK.
    4. Enter the following text:
    5. declare
      
      video_obj ole2.obj_type;
      begin
      video_obj := forms_ole.get_interface_pointer (`MY_VIDEO');ole2.invoke(video_obj,`ImportStreamAs');
      end;
    6. Choose Compile.
    7. Choose Close.
  5. Create another trigger. This trigger prevents Forms from trying to log into a database when you run the form:
    1. Choose PL/SQL Editor from the Tools Menu.
    2. Change Object to Form Level.
    3. Choose New.
    4. Choose ON-LOGON as the type of trigger and click OK.
    5. Enter the following:
    6. null;
      
    7. Choose Compile.
    8. From the File Menu, Choose Save.
    9. Choose Close.

Viewing the Application

  1. View your final application by choosing Run from the File menu. A dialog box appears asking if you want to log on before performing compilation. Choose No.
  2. Click either the Local Videos or Server Videos button to select a video. After you select a video, the Play button will turn green. Click on this button to play the video.

Accessing Methods and Properties

When working with forms, the commands in the PL/SQL scripts that work with the Oracle Video Custom control take different forms depending on whether they are:

Executing a Method

For buttons that execute a method, the PL/SQL script for the WHEN-BUTTON-PRESSED trigger should follow this form:

declare 

      video-obj ole2.obj_type; 



begin

      video-obj := forms_ole.get_interface_pointer('OLE-object-name'); 

      ole2.invoke(video-obj, 'method'); 

end; 

video-obj

is a variable name

OLE-object-name

is the name of the video object

method

is the name of the method to invoke (such as play, stop, and so on).

Setting the Value of a Property

For buttons that set a property, the PL/SQL script for the WHEN-BUTTON-PRESSED trigger should follow this form:

declare 

      video-obj ole2.obj_type; 



begin 

      video-obj := forms_ole.get_interface_pointer('OLE-object-name');

      ole2.set_property(video-obj, 'property','value')

end; 

video-obj

is a variable name

OLE-object-name

is the name of the video object

property

is the name of the property to be set (such as ShowControls).

value

is the value to be assigned to the property (such as True or False).

Getting the Value of a Property

For buttons that get the numeric value of a property, the PL/SQL script for the WHEN-BUTTON-PRESSED trigger should follow this form:

declare 

      video-obj ole2.obj_type; 

      variable num;



begin 

      video-obj := forms_ole.get_interface_pointer('OLE-object-name');

      variable = ole2.get_num_property(video-obj, 'num-property')

end; 

When getting the string value of a property, the script should follow this form:

declare 

      video-obj ole2.obj_type; 

      variable char;



begin 

      video-obj := forms_ole.get_interface_pointer('OLE-object-name');

      variable = ole2.get_char_property(video-obj, 'char-property')

end; 

video-obj

is a variable name

OLE-object-name

is the name of the video object

char-property

is the name of a that returns a character value (such as ImportFileSpec).

num-property

is the name of a property that returns a numeric value (such as LengthTime).

Modifying Properties

To set the Oracle Video Custom Control properties, click the primary mouse button in the Oracle Video Custom Control object, then drag down to the Oracle Video Control Object->Properties...

If you double click on the Oracle Video Custom Control object, you will get an Oracle Forms properties dialog, but you cannot set the Oracle Video Custom Control properties from this dialog.

Note

If you set any visual properties (such as ShowControls) to False, the controls disappear in the designer, but the change will not be reflected at run time. To see the changes in the run time, you must close the Layout Editor to save the changes, run the form, then it will work.

Troubleshooting

When using Oracle Forms, you might receive this run-time error:

FRM-41344: OLE object not defined for object in current record. 

which can occur for either of these reasons:

To fix this problem, go into the Forms Designer, and re-insert the Oracle Video Custom Control by clicking the right mouse button inside the OLE container and choosing Insert Object

To fix this problem, modify the form so that it can navigate to the block that contains the Oracle Video Custom Control. You can either make this block the first block on the form or add a GO_BLOCK command in the WHEN-NEW-FORM-INSTANCE script to navigate to that block. If necessary, you can add a GO_BLOCK command followed by SYNCHRONIZE before any commands that access the Oracle Video Control. (You can tell if the Oracle Video Control has been initialized because the video control buttons will be visible.)




Prev

Next
Oracle
Copyright © 1997 Oracle Corporation.
All Rights Reserved.

Library

Product

Contents

Index