Installation

CoSolvent Player is deployed as a Flash 9 'Applet'. All configuration is done via the flashvars parameter of the html object tag representing the player on a page. There are several Javascript libraries available that make embedding flash easy and safe across multiple browsers. We recommend swfobject.

Our standard configuration method is to set a single flashvar property encoded in JSON. Below is a code example of embedding the CoSolvent Player using swfobject.

The following example configures a playlist consisting of two FLV videos. Note the height setting in the swfobject call; 24 pixels are added to the video height. Each of our three default control bars are 24 pixels high.

var flashvars = {
JSON: '{"debug":true,' +
'"ui":{"style":"light"},' +
'"vitems":[' +
'{' +
'"id":"1",' +
'"layer":"video",' +
'"url":"Bourne Ultimatum - Trailer.flv",' +
'"variant":"flv",' +
'"width":1920, "height":816' +
'},' +
'{' +
'"id":"2",' +
'"layer":"video",' +
'"url":"I Am Legend - Trailer.flv",' +
'"variant":"flv",' +
'"width":1920, "height":816' +
'}' +
']}'
};
var params = {
swfliveconnect: "true",
allowScriptAccess: "always",
salign: "lt",
scale: "noscale",
loop: "false"
};
var attributes = {
name: "CosolventPlayer",
id: "CosolventPlayer"
};

swfobject.embedSWF("CosolventPlayer.swf", "flashcontent",
"1920", "840", "9.0.0", "expressInstall.swf",
flashvars, params, attributes);

The above example is self-contained with the exception of swfobject, thus the JSON string is presented inline; however, there are a number of Javascript libraries available which provide functions to generate JSON serializations. The Dojo Toolkit is one such library.

Configuration

Configuration options, along with the corresponding default values, are listed below.

Logging

If set to true, the player will attempt to open a local connection to communicate with the Alcon debugging utility.

debug: "true" | "false"

Default is false.

UI

Configuration is to be done inside of an object called ui:

	ui: { 	
trackUsage: true | false (default false)
buttonHoverColor: "<color>" (e.g. 0xff0000)
video: {
backgroundInsideColor: "<color>" (inside of radial gradient)
backgroundOutsideColor: "<color>" (outside of radial gradient)
backgroundInsideRatio: "<color>" (inside ratio of radial gradient)
backgroundOutsideRatio: "<color>" (outside ratio of radial gradient)
}
}

 

Playback

autoplay set to true indicates that playback should begin automatically after sufficient loading.

autoplay: "true" | "false" (defaults to false)
driverLayer: "<layer name>" (video or audio, default is video)

 

Virtual Timeline

assetURL indicates a prefix for all urls specified with in the vitems array

assetURL: "<url>"     

vitems is a javascript array containing an object for each desired virtual item

vitems: [
{
id: <id>,
layer: "<layer name>",
url: "<url>",
variant: "<variant>",
start: <mark in>,
end: <mark out>,
...
}
]

Each object would represent one virtual item.

Required Item Properties
  • id should be a unique positive integer.
  • layer is either video, audio, or script (we plan on supporting more for PiP etc.)
  • url must specify a valid relative or absolute path to the asset on which the item depends. note that the provided url will be concatenated with assetURL if specified
  • variant used to specify file type, current settings available are flv, mp4, avm1, and avm2
Optional Properties
  • start is the item relative mark in, which, depending on the asset, specified in either frames or millisecond time
  • end is the item relative mark out, which, depending on the asset, specified in either frames or millisecond time
  • endDetectionThreshold time in milliseconds, if no end is specified for FLV, an algorithm is used internally to detect the end point, try setting this value higher if you encounter problems with transitions on FLV assets (default is 800)
  • antialias for FLV/MP4, specify whether to perform smoothing on scaled video (default true)
  • loadPriority a number representing loading priority for the asset on which the item depends, the higher the number, the sooner the asset will load
  • bufferTrigger for bufferable media, a millisecond time indicating buffer sensitivity
  • bufferAhead a millisecond time indicating how far ahead of the current position to buffer when buffering begins
  • bandwidthSensitivity for assets that have bandwidth detection as a part of prebuffering (currently mp4 and flv), this number indicates how sensitive the prebuffering should be to that calculation, i.e. if the number is set to 0, the bandwidth calculation will be ignored altogether and playback will begin as soon as bufferAhead time has buffered, if the number is set to 100 (the default), playback will begin when the bandwidth calculation indicates that no further buffering will be needed during playback
Asset Specific Properties
Video
  • width is the scaled video width in pixels (defaults to realWidth)
  • height is the scaled video height in pixels (defaults to realHeight)
  • realWidth is the actual video width in pixels, must be supplied for flv that does not contain metadata, and for avm1
  • realHeight is the actual video height in pixels, rules same as for realWidth
  • fps is video frames per second
  • version for swf video, the flash version number
  • startEndUnits for swf, either "s" or "ms" indicating seconds or milliseconds respectively, if left off, frame numbers are expected
Script
  • linkTo the id of the video or audio to which the script corresponds, the script activation will be dependent on the particular video timeline
Audio
  • linkTo the id of the video to which the audio corresponds

 

XML Annotations

In the following code samples, times are measured in milliseconds. If the script has a linkTo parameter set in the timeline,  the times will be local to a video. Otherwise, they reference the virtual timeline.

Subtitles are described in xml as follows:

<innerscript>
<script>
<timeddata start"0" end"3000">Text for first subtitle.</timeddata>
</script>
</innerscript>

Markers are described similarly:

<innerscript>
<script>
<marker name="marker1" time="28000" />
</script>
</innerscript>

Actions and Interactions are placed in a separate element:

<innerscript>
<interactions>
<perform action="gotoMarker|marker1" time="36000" />
<button text="continue" action="play" placement="bottom right" time="43000" />
</interactions>
</interactions>

The button interaction will, by default, first pause the video, then display a button to the user at the specified placement, and then perform the specified action when the button is clicked.


These features are only available in the Professional version of the CoSolvent Player.