GithubHelp home page GithubHelp logo

agiza / flowplayer-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from heshanlk/flowplayer-api

0.0 2.0 0.0 60 KB

An API module for Drupal to provide integration with the GPL licensed Flowplayer for Flash video playback.

Home Page: http://drupal.org/project/flowplayer

flowplayer-api's Introduction

Features

    * Easily adds Flowplayer support to other systems
    * Takes advantage of Drupal JavaScript Behaviors
    * Applying any configuration option is simple
    * jQ module support
    * Stripped down to just the API to provide an integration point for other modules
    * Global custom styling options to change how it looks

Integration

    * Embedded Media Field
    * Blue Droplet Video
    * Video

API

To create Flowplayer elements, you can either use the theme('flowplayer') function, or the flowplayer_add() function. The theme function will add the JavaScript to the page, as well as create the markup for you, while the flowplayer_add() function will just add the JavaScript. To see both methods in action, install the module, and visit admin/help/flowplayer.
Theme Function

Calling theme('flowplayer') will not only add the correct JavaScript to the page, but also construct the markup for you. The second argument passed through here is the video URL, but you can pass the configuration options instead as seen below.
<?php
  $video = theme('flowplayer', 'http://player-e7.simplecdn.net/flowplayer.flv');
  $video2 = theme('flowplayer', array(
    'clip' => array(
      'url' => 'http://player-e7.simplecdn.net/flowplayer.flv',
      'autoPlay' => FALSE, // Turn autoplay off
    ),
  ));
?>
Flowplayer Add

The flowplayer_add() function will add the Flowplayer JavaScript to the page, as well as register the Drupal JavaScript behaviors to load the Flowplayer appropriately. The first argument is the jQuery selector to apply the Flowplayer element to. The second argument is the configuration options. Using flowplayer_add requires you to already have the markup created.
<?php
  $video = '<a href="http://player-e7.simplecdn.net/flowplayer.flv" id="player" class="flowplayer"></a>';
  flowplayer_add('#player', array(
    'clip' => array(
      'autoPlay' => FALSE, // Turn autoplay off
      'linkUrl' => 'http://flowplayer.org', // When clicked on
    ),
  ));
?>

flowplayer-api's People

Contributors

heshanlk avatar

Watchers

James Cloos avatar Anthony Giza avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.