Media Player

OpenOffice.org 2.0

Document - ID	Specification Owner	Last Change	Status
	Kai Ahrens	07/23/04	draft
Conforms to	
Applies to	All applications
Task ID(s)	100255 Gallery: Not possible to add a sound to the Gallery i6880 - Problems with movies and links to programs in Impress i4645 - Importing Mpeg video into presentations i3316 - Cant insert movies - mpg, avi etc
Category	Feature

Abstract

This document is about integrating a media player solution to OpenOffice.org. For OOo 2.0, the most requested features by our users should be implemented; namely: inserting arbitrary media content into a document, adding support for more types of media files for the Gallery and offering an integrated MediaPlayer solution. The solution should be independent of players that are offered by the underlying system or additionally installed.

i-Team Members

	Name	E-mail Address
Specification Owner	Kai Ahrens (KA)	Kai.Ahrens@sun.com
User Experience	Christian Jansen (CJ)	Christian.Jansen@sun.com
Development	Kai Ahrens (KA)	Kai.Ahrens@sun.com
Quality Assurance	Stefan Baltzer (SBA) Oliver Craemer (OC) Wolfram Garten (WG)	Stefan.Baltzer@sun.com Oliver.Craemer@sun.com Wolfram.Garten@sun.com
Documentation	Uwe Fischer (UFI)	Uwe.Fischer@sun.com
String Review	Elizabeth Matthis (EM)	Elizabeth.Matthis@sun.com

Approved for Implementation

	Approved by	Date
User Experience	CJ	
Development	KA	07/21/04
Quality Assurance	WG	
Documentation	UFI	
String Review	EM	

Document Change History

Rev. Level	Change	Initials	Date
0.1	Initial revision	KA	07/08/04

Contents

1	Glossary	1

2	Motivation	1

3	User Scenarios	1

4	Goals	2

5	Requirements and Dependencies	2

5.2	Requirements	2

5.3	Technical Dependencies	2

6	Competitive Analyses	2

7	Detailed Specification	3

7.1	Adding media files to a document	3

7.2	Using the MediaPlayer	7

7.3	Previewing a Gallery media item	9

7.4	Media playback inside a presentation	9

7.5	Error Conditions	9

7.6	String list	10

8	Future Tasks	10

9	Notes	11

10	References	11

Glossary

Term	Description
Media file	A source for data, representing audio and video content
Media Player	A tool to load and play media files. In general, this tool is realized as a floating window with all necessary controls and the playback window integrated
JMF	JavaMediaFramework - a toolkit to implement media players. Such a toolkit offers backend functionality to load media files, filter the incoming media stream and render the filtered data either via a sound device for audio data and/or the display for video data
DirectShow	A toolkit offered on Windows system to implement media players. Functionality is the same as with JMF (see above)

Motivation

With OpenOffice.org 1.1 users can add audio and video files to their documents only if they have installed the appropriate Netscape plugins on their system. This means that there is no integrated solution available with OOo 1.1 to insert media content into a document.

In the case of the Gallery, it is possible with OOo 1.1 to add 'Wave' , 'AIF' and 'AU' audio files to the appropriate Gallery theme, which is just a small subset of all available audio formats. 'Modern' and widely used formats like MP3 can not be added in any case. It is not possible with OOo 1.1 to add video files to the Gallery.

These limitations are not acceptable for a modern Office suite and users don't accept such limitations for their daily work.

User Scenarios

There are four different scenarios we have to distinguish between:

The user adds a media file to a document
In this case an object is inserted into the document that represents the media content. A toolbar will be available after selecting the object to control the playback. In the case of pure audio files, a logo will be shown inside the object frame, in the case of video files, the video playback will happen inside the object frame

Media playback inside a presentation
Having media objects on slides in Impress application requires special handling in the presentation case. Main difference is that no UI elements will be visible to control the media playback in detail.

The user plays a media file inside a MediaPlayer
In this case, the user opens a MediaPlayer via the Menu or a toolbar button. The MediaPlayer contains all playback controls and the playback window itself.

A Gallery item is to be previewed
In this case the above mentioned MediaPlayer will be opened to playback the selected Gallery media item. There is no connection between the Gallery and the MediaPlayer after submitting the URL from the Gallery to the MediaPlayer

Goals

All mentioned user scenarios should be handled appropriately with the OpenOffice.org 2.0 implementation of an own Media Player framework. There should be an own implementation for all GUI elements, which means that 3rd party toolkits for media playback should only be used as a backend. Every frontend detail has to be realized with the OpenOffice.org GUI framework.

Requirements and Dependencies

Requirements

-

Technical Dependencies

Although the frontend and the integration visible to the user will be completely realized with the OpenOffice.org programming framework, the underlying functionality to load, filter and render media files will be deligated to 3rd party frameworks. In the first run we will use the JavaMediaFramework (JMF) on Unix systems and the DirectShow API on Windows systems. DirectShow has been chosen for Windows systems due to its tighter integration with the system, so that the user has all media formats available that can be played with the WindowsMediaPlayer There's no such common solution available for other systems, so that we are free to use a framework of our choice here. JMF is a good compromise in this case, since it is very small and available on many platforms. JMF has a modern architecture, is extendable and has a very clear programming API. Writing additional backend implementations is possible in every case.

DirectX is available on all relevant Windows Systems, so that the usage of DirectX should not be a problem in any case, which means that media support should be possible on every Windows system without additional user action.

In the Unix case, there is no 'general' solution available on every system, so that we have some prerequisites here to offer media support. Using JMF as a backend doesn't mean that OpenOffice will ship JMF itself, but that JMF has to be installed on the destination system and that it has to be configured correctly by the user. The same holds true for any additional backend that will be written in the future.

Necessary user actions to use JMF as backend for media playback:

JMF has to be installed and configured on the destination system

The path to the installed Jar file on the system (jmf.jar) has to be set in OpenOffice. To do so, the Tools->Options Menu offers a TabPage for Java specific settings, where additional classpath settings can be made.

Competitive Analyses

A good comparison to our concept is the Windows MediaPlayer available on Windows system, the media integration in competetive applications, as well as many other available MediaPlayers like Xine, MPlayer, Totem or VLC.

Detailed Specification

Adding media files to a document

Activation

Every major application (OpenOffice.org Writer, Calc, Draw and Impress) offers a new menu entry inside the 'Insert' menu as well as a new toolbar button inside the 'Insert' toolbox. The menu entry as well as the tooltip help have got the title 'Movie and Sound'

Figure 1Insert 'Movie and Sound' menu entry

Figure 2Insert 'Movie and Sound' toolbox entry

StringList

Item	English	German	Comments
Menu Entry	Mo~vie and Sound	Film und ~Klang	
Tooltip	Movie and Sound	Film und Klang	

User Actions

Figure 3Selecting a media file After activating the approprioate UI element a 'File Open' dialog is displayed to select the media file. The title of this dialog is 'Insert Movie and Sound':

The current list of available media filters is as follows:

All movie and sound files

AIF Audio

AU Audio

AVI

CD Audio

MIDI Audio

MPEG Audio

MPEG Video

Quicktime Video

Vivo Video

WAVE Audio

All files (*.*)

String List

Item	English	German	Comments
Dialog Title	Insert Movie and Sound	Film und Klang einfügen	
Filter Entry	All movie and sound files	Alle Film- und Klangdateien	
Filter Entry	All files (*.*)	Alle Dateien (*.*)	
Filter Entry	AIF Audio	AIF Audio	
Filter Entry	AU Audio	AU Audio	
Filter Entry	AVI	AVI	
Filter Entry	CD Audio	CD Audio	
Filter Entry	MIDI Audio	MIDI Audio	
Filter Entry	MPEG Audio	MPEG Audio	
Filter Entry	MPEG Video	MPEG Video	
Filter Entry	Quicktime Video	Quicktime Video	
Filter Entry	VivoVideo	Vivo Video	
Filter Entry	WAVE Audio	WAVE Audio	

Since it is not possible for every backend to query for all available formats, a predefined set of common media filters is used, which has the side effect, that not necessarily all filters are supported on every system.

After selecting a file and pressing the OK button, a media object is inserted into the document that represents the media file. If a media object is already selected, the chosen URL is set at this already existing media object. A media object behaves like any other object, but is best compared to graphics objects, showing some content that depends on a chosen URL. The object determines the visible frame into which any media content is rendered, it contains no control elements at all. The only interactive transformation possible for such kinds of objects is positioning/resizing:

Figure 4Video object

In the case of audio content, an icon is shown inside the playback area (object fame):

Figure 5Sound object

The context menu for a selected media object needs to have (at least) the following entries. In addition those necessary menu entries, each application can add application specific menu entries. The position of the menu entries is according to existing menu layout guidelines:

Position and Size

Cut

Copy

Paste

In the case of an invalid media file, no object is inserted into the document or replaced and the file dialog is closed immediately.

Controlling the media stream

Since the media object itself does not contain any UI element to control the playback of the media file, it is necessary to offer this UI at a different location. The appropriate place for this is the objectbar, which is switched in the case of selecting a media object. This media related objectbar is enabled in the case of selecting one and only one media object. In the case of a multi selection, all controls inside this objectbar are disabled or, depending on the type of selected object, the objectbar itself is switched to another type.

The media object bar contains all necessary elements to control the playback of a media file:

Figure 6Media object bar

Contolling the playback itself is done with the 'Play', the 'Pause' and the 'Stop' buttons. If the media playback position is at the beginning or at the end of the media stream and the object is not played, the media object is in the Stop state. Pressing the Play button starts the playback from the beginning of the stream in these cases. If the position is somewhere between the start and the end position, but the object is not played, the media object is in the Pause state. Pressing Play again in this state continues the playback from the current position. Pressing the Stop button stops playing and resets the media position to the beginning. Pressing the Pause button just stops playing but does not reset the media position.

Activating the 'Repeat' button repeats the playback from the start of the media file after the end of playback has been reached.

A slider displays and controls the current media stream position. Adjustments of the actual media stream positions are made after the slider has been released. The media stream position itself is displayed together with the total length of the media file inside an edit field.

The audio output can be controlled by the 'Mute' button and the Volume slider. If Mute is activated, the level of audio output is set to zero, so that no audio output can be heard anymore until the Mute button is toggled. The volume slider controls the volume of the audio output.

The scaling of the video output is controlled by a View list, containing several entries. 100% percent represents video output with the original size of the media file, whereas 50% and 200% are scaled down/scaled up settings by a factor of 2. In addition, The Scaled option allows to fit the media output into the object frame, preserving the aspect ratio of the original media file.

String List

Item	English	German	Comments
Objectbar Title	Media playback	Medienwiedergabe	
Tooltip	Play	Abspielen	
Tooltip	Pause	Pause	
Tooltip	Stop	Stopp	
Tooltip	Repeat	Wiederholen	
Tooltip	Mute	Stumm	
Tooltip	Volume	Lautstärke	
Tooltip	View	Ansicht	
ListBox Entry	50%	50%	
ListBox Entry	100%	100%	
ListBox Entry	200%	200%	
ListBox Entry	Scaled	Angepaßt	

Media object properties

The media object itself needs to hold some properties, that will be persistent. Beside the URL of the media file, the repeat state, the mute state, the volume level and the current view state are to be saved. The current play state and playback position is not saved.

With this properties, switching from a slide or page containing a media object that is currently played to another slide or page saves the current repeat state, the mute state, the volume level and the current view state. Switching back to the old page afterwards restores the repeat state, the mute state, the volume level and the current view state. The same holds true for transfering a media object via clipboard or loading an existing document containing a media object.

Using the MediaPlayer

Activation

Every major application (OpenOffice.org Writer, Calc, Draw and Impress) offers a new menu entry inside the 'Tools' menu. The menu entry has got the title 'Media Player':

Figure 7'Media Player' menu entry

String List

Item	English	German	Comments
Menu Entry	Media Pla~yer	Mediapla~yer	

User Actions

After activating the appropriate UI element, a floating window containing all controlling elements as well as the playback window is opened. The initial state of this window is 'floating' (not docked). The title of this floating window is 'Media Player':

Figure 8Media Player without selected file

String List

Item	English	German	Comments
Menu Entry	Media Player	Mediaplayer	

Media player UI

The controls of the Media Player are the same and handled in the same way as described for the media object bar (see above). There is just a slight difference in the arrangement of the controls: the media object bar contains all controls in a single line, the Media player uses two lines for the layout.

In addition to the media object bar, the Media Player contains an ''Open' button to select a different media file to be played inside the Media Player and an 'Insert' button to insert a media object to the active document, that is based on the current URL of the Media Player. If the Media Player doesn't contain a valid URL, the 'Insert' button is disabled. The 'File Open' dialog that appears after pressing the 'Open' has got the title 'Open Movie and Sound' in this case.

String List

Item	English	German	Comments
Tooltip	Open	Öffnen	
Tooltip	Insert	Einfügen	
Dialog Title	Open Movie and Sound	Film und Klang öffnen	

Previewing a Gallery media item

If a media item inside a Gallery theme is to be previewed, the Media player (see above) is opened immediately if not done yet and the URL of the media item to be previewed is sent to the Media Player. All current playback of the Media Player is canceled and the playback of the new media file starts immediately.

Media playback inside a presentation

The media object will be initially visible inside the presentation but will not be controlled by any UI elements. Instead, playback is started by a single click at the object itself. In addition to this behavior, the user can choose to start the playback as soon as the media objects gets visible inside the presentation. The UI for this is not part of this specification (see presentation engine spec for details)

Error Conditions

In case of trying to insert or open a media file that is not valid or cannot be opened with the framework available on the specific platform, the following error is shown:

Figure 9Format error handling

String List

Item	English	German	Comments
Error Message	The format of the selected file is not supported	Das Format der gewählten Datei wird nicht unterstützt	

Future Tasks

Create backends for different frameworks like Xine, Mplayer and VLC.

Notes

References

Media Player for OpenOffice.org 2.0

Page 11

http://specs.openoffice.org/appwide/mediaplayer/MediaPlayer.sxw

Philipp Lohmann

2004-04-07T11:32:16