Skip to content
This repository was archived by the owner on Oct 10, 2018. It is now read-only.

Plugin to provide access to functionality only available in the Flash-only player API when otherwise using the Smart Player API

Notifications You must be signed in to change notification settings

silevitas/Brightcove-Flash-API-Bridge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flash Player API Bridge

This plugin exposes some methods of the Flash-only Player API to javascript. The intended use is for when you want to use the Smart Player API in the page, but need to access some functionality that is only implemented in the Flash-only player API.

##Usage

Add the swf plugin to the player as a plugin in player settings or as a module in the BEML template. Remember to have a crossdomain policy file on your server hosting the plugin to enable Flash to load the plugin

The Flash-only player API methods that have been implemented can be accessed from the swf object on the page. For instance, to have the player volume set to 50%:

<object id="myExperience123456789" class="BrightcoveExperience">
...
  <param name="inlcudeAPI" value="true" />
  <param name="templateReadyhandler" value="onReady" />
</object>

<script>
function onReady(event) {
  // Using this plugin:
  var fapiPlayer = document.getElementById(event.target.experience.id);
  fapiPlayer.fapiSetVolume(0.5);
  
  // Using regular Smart PLayer API:
  var player = brightcove.getExperience(event.target.experience.id);
  //... Smart Player API code...
 }
 </script>

Events will be triggered if a window.fapiEvent function exists at the point the plugin is loaded.

<script>
function fapiEvent(id,event) {
  console.log ("Player " + id + " dispatched event " + event.type);
}
</script>

###Methods implemented

###Events implemented

  • ExperienceEvent.ENTER_FULLSCREEN
  • ExperienceEvent.EXIT_FULLSCREEN
  • MediaEvent.BUFFER_BEGIN
  • MediaEvent.BUFFER_COMPLETE
  • MediaEvent.MUTE_CHANGE
  • MediaEvent.RENDITION_CHANGE_COMPLETE
  • MediaEvent.RENDITION_CHANGE_REQUEST
  • MediaEvent.VOLUME_CHANGE

About

Plugin to provide access to functionality only available in the Flash-only player API when otherwise using the Smart Player API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • ActionScript 100.0%