Skip to Content

ccPlayer Help

Embedding ccPlayer Inside Another SWF

It is now possible to embed the AS3 version of ccPlayer inside another SWF. There are two methods used to set ccPlayer's display and media playback. Both methods are passed many of the parameters that are set via the Flashvars parameters when ccPlayer is embedded on a web page, such as ccMediaName, ccMediaWidth and ccMediaHeight. Any additional parameters can be set as ccPlayer properties.

Additional methods are included which will allow for such things as pausing the media playback, triggering the fullscreen display, and getting the current media time. To create a player that will play consecutive media files, an event is dispatched whenever the current media finishes playing in order to start the next media item.

Initializing the ccPlayer SWF

Once the ccPlayerAS3.swf is loaded, the initccPlayerDisplay() method must be called to initialize the size of ccPlayer's media display and indicate which controls to use. Afterwards, the setNewMediaPlayback() method is used to set up the next media to be played. This method can be used in conjunction with the end-of-playback event to play consecutive media files. Any parameters that need to be set, which aren't included in the setNewMediaPlayback() parameters, should be set prior to calling this method. At any time the size of the player display and the controls can be changed by recalling the initccPlayerDisplay() method.

Sample file

A sample file (embedding_ccPlayer.fla), which contains sample code for loading and controlling the ccPlayerAS3.swf, is provided in ccPlayerAS3's download package. A demonstration of ccPlayer embedded in another SWF can be found on the ccPlayer Examples page.

Fullscreen view

When ccPlayer's fullscreen view mode is selected, ccPlayer positions itself in the upper left corner of the screen and expands its black background to fill the entire screen. Any objects in layers underneath the ccPlayer object will be covered and any objects positioned on layers on top of ccPlayer will remain visible.

Methods

Properties

Event