Skip to content

definitionstudio/linktv_player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Link TV Player

Link TV Player is a standalone Flash® video player, written in ActionScript 3. Developed for ViewChange.org and Link TV Platform, the player supports streaming and progressive video sources, as well as YouTube videos.

Features

  • Streaming (RTMP) or progressive (HTTP) video playback
  • MP4 (H.264) and FLV/F4V media support
  • YouTube video support, via the YouTube Chromeless Player API.
  • "High quality" video option
  • Segment/chapter support
  • Embedded display mode

Dependencies

Configuration

Flashvars:

  • config (string): JSON-encoded config object (see below)
  • configUrl (string): URL of JSON config data (valid only if config not provided)

Config object:

  • startTime (integer): Video start time (default: 0)
  • playerId (string): Player DOM ID (required when passing eventHandler)
  • eventHandler (string): JavaScript callback for handling player events
  • embedded (boolean): true for embedded display mode (iframe)
  • fullscreen (boolean): false to disable fullscreen controls
  • resize (boolean): true to enable resize controls (requires eventHandler, ignored if embedded = true)
  • autoplay (boolean): true to begin playback without user interaction
  • permalinkId (string): Video GUID
  • permalinkUrl (string): Video URL
  • streamHost (string): RTMP host, with prefix
  • mediaType (string): "internal", "youtube", "brightcove"
  • mediaStatus (object): set custom video unavailable message (optional)
    • available (boolean)
    • message (string)
  • media (array)
    • (object):
      • url (string): media file URL, YouTube URL or Brightcove video ID
      • size (integer): File size, in bytes
  • duration (integer): Video duration, in seconds
  • title (string): Video title
  • description (string): Video description text
  • posterImage (string): Image URL
  • posterAttribution (string): Image attribution text
  • segments (array):
    • (object):
      • id (integer): Numeric ID
      • startTime (integer): Start time, in seconds
      • title (string): Segment title
      • thumbnail (string): Image URL
  • trackPlayUrl (string): URL for tracking play event (POST)
  • userId (string): Optional user ID for play event tracking
  • googleAnalyticsId (string): Google Analytics ID for GA event tracking (required if googleAnalyticsMode is "AS3")
  • googleAnalyticsMode (string): "AS3" or "Bridge" (default: "AS3"). Bridge mode supports GA async tracking. See gaforflash docs for more info.
  • player (object): Player UI customizations
    • controlsBgColor (string): Hex color
    • controlsBgOpacity (float): Decimal, 0.0 – 1.0
    • controlsTextColor (string): Hex color
    • progressBarTrackColor (string): Hex color
    • progressBarTrackOpacity (float): Decimal, 0.0 – 1.0
    • progressBarLoadColor (string): Hex color
    • progressBarColor (string): Hex color
    • segmentNavColor (string): Hex color
    • segmentNavOpacity (float): Decimal, 0.0 – 1.0
    • segmentNavActiveColor (string): Hex color
    • segmentNavActiveOpacity (float): Decimal, 0.0 – 1.0
    • segmentInfoBgColor (string): Hex color
    • segmentInfoBgOpacity (float): Decimal, 0.0 – 1.0
    • segmentInfoTextColor (string): Hex color
    • headerBgColor (string): Hex color
    • headerBgOpacity (float): Decimal, 0.0 – 1.0
    • headerTextColor (string): Hex color
    • linkTextColor (string): Hex color
    • tooltipBgColor (string): Hex color
    • tooltipBgOpacity (float): Decimal, 0.0 – 1.0
    • tooltipTextColor (string): Hex color
  • brightcovePlayerId (integer): required for "brightcove" mediaType
  • brightcovePlayerKey (string): required for "brightcove" mediaType

External Methods

  • playVideo(): Begin playback
  • pauseVideo(): Pause playback
  • seekTo(seconds:integer, autoplay:boolean): Seek to time, in seconds, with optional autoplay
  • seekToSegment(segmentId): Seek to beginning of segment
  • getCurrentTime(): Returns playhead time, in seconds
  • trackViewTime(): Trigger view time/percentage analytics events

Player Events

Player events are dispatched to the JavaScript callback function defined in the eventHandler config option. The eventHandler callback will receive a single event object argument. The following events are currently dispatched by the player:

  • stateChange (object): dispatched when the video state changes
    • type (string): "stateChange"
    • playerId: player DOM ID
    • state (integer): possible values are unstarted (-1), ended (0), playing (1), paused (2), buffering (3), video cued (5)
  • segmentChange (object): for multi-segment videos, dispatched when playback of a new segment begins
    • type (string): "segmentChange"
    • segment (integer): ID of segment beginning playback
    • playerId: player DOM ID
  • scaleUp (object): dispatched when resize control is clicked (scaling up)
    • type (string): "scaleUp"
    • playerId: player DOM ID
  • scaleDown (object): dispatched when resize control is clicked (scaling down)
    • type (string): "scaleDown"
    • playerId: player DOM ID

Examples

See the examples directory for embedding examples using SWFObject. You may encounter Flash Player security warnings if attempting to run the files locally.

Customization

You are free to modify the player without restriction. You will need Adobe Flash CS4 or higher to publish the player SWF.

Acknowledgements

Google Analytics Tracking For Adobe Flash, an Apache 2.0-licensed project, is bundled with this distribution. More information available at http://code.google.com/p/gaforflash/

License

Distributed under the MIT License, copyright (c) 2011 Definition LLC. A project of Link Media, Inc.