Closed (fixed)
Project:
JW Player
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Nov 2011 at 17:46 UTC
Updated:
30 Jun 2012 at 14:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
rickvug commentedI've spoken with colleagues about this functionality. Notes from the conversation are below:
The JW Player module is meant to be a "generic" module that can be used as the base for any JW Player implementation. As such it would not be appropriate to implement specific plugins such as GA Pro and not others. Instead the JW Player module should provide a flexible API that allows other modules to register JW plugins on their own. At this point we could potentially register popular plugins from with the module itself by implementing the modules own API, but it would be just as simple to implement the relevant hook(s) from a module such as jw_player_ga_pro.
Specifically we spoke about a hook such as hook_jw_player_plugin_info() (or alternately hook_jw_player_plugin_register() or just hook_jw_player_plugin()). This hook would allow any module to register a plugin and all of its available configuration options with JW Player. The array format would be something like this:
The human readable text for the plugin and configuration would be made available from within the presets form. This could be accomplished by calling something like jw_player_plugins_load(), which would fire the hook implementations and return all registered plugins. From this information the preset configuration form could be created. Which plugins are enabled and the settings for each plugin would be saved as part of a preset.
When rendering the player itself the configuration would be added to the JW player configuration as follows:
While we have a fairly good idea of what needs to be accomplished many questions remain:
Comment #2
girishmuraly commentedAttaching patch based on similar outline @rickvug set
With this patch, modules can implement
hook_jw_player_plugin_info()andhook_jw_player_plugin_info_alter()to register and alter preset-plugins respectively.The plugins should be registered in this format:
Also created a GA Pro2 plugin at http://drupal.org/sandbox/girishmuraly/1344992.
Comment #3
rickvug commented@Girish The code looks good. Committed! Let's continue to monitor the architecture for plugins as additional use cases come up. At the moment reworking #1318342: Add support for Closed captions and Audio Descriptions to use this new plugin API would be an excellent test case.
Comment #5
remy40 commentedHi,
I'm currently working on a drupal module to support JW Player captions plugin, using your plugin interfaces.
Some plugins need to update their config dynamically using some field data, or anything else, so I have added a call to a "plugin config update" function in jw_player_preprocess(). I don't know if it's the best method.
Here is the patch.