Currently the implemented theme functions to get the player out are hard to re-use in other cases other than a pure cck field.
Also, the dimensions of the player is hardcoded into theme_brightcove_cck_embed
, which makes it almost allways needed to override it on template.php or create a new formatter duplicating functionality.
Part of these functions should be abstracted into utility functions.
Please do chip in so that we get a clear path as to how to make this module enter the next stage.
Related issues:
#1388264: Input filter for embedding videos [PATCH]
#1411458: [PATCH] Ability to configure different players
Comment | File | Size | Author |
---|---|---|---|
#5 | 1392474-refactor-rendering-2.patch | 13.03 KB | Manuel Garcia |
#4 | 1392474-refactor-rendering.patch | 12.68 KB | Manuel Garcia |
#3 | 1392474-refactor-theming.patch | 13.33 KB | Manuel Garcia |
Comments
Comment #1
Manuel Garcia CreditAttribution: Manuel Garcia commentedI will be spending the day working on this.
Join the fun in #drupal-brightcove IRC channel.
I propose we move towards a function like
brightcove_embed_video($vid, $width, $height, $playerID);
, which would return an html string with the absolute necessary markup for printing the video player.Having the function take width, height, and PlayerID as parameters would give us the flexibility for implementing different players & dimensions in the future, which could be added to the field settings in a latter step. For now the function will grab the defaults if none are specified while calling the function from the standard formatter. It also means that if you call it manualy by code you could have different players etc already.
I propose we move adding
<script type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
into a hook_init() implementation. So that we can use this function within imput filters, and avoid having to worry if there's more than one video on the page, etc.Please share your thoughts on this or other ideas you have in mind. Let's first make the module's code flexible enough then implement form elements for configuring stuf through the UI.
Comment #2
Manuel Garcia CreditAttribution: Manuel Garcia commentedProposed funciton WIP:
Comment #3
Manuel Garcia CreditAttribution: Manuel Garcia commentedOK, here's a first working patch.
Includes Major refactoring of player embedding process:
drupal_set_html_head('<script type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>');
intobrightcove_init()
.theme_brightcove_cck_embed()
function in favour of newbrightcove_embed_video()
function. This new function lives inside brightcove.module so that you don't need to use brightcove_cck if you don't want to (for example, if you only use an input filter). It includes functionality that was being done in different places for default configurations.theme_brightcove_cck_embed
to use the new function and removed leftover unnecessary code.theme_brightcove_cck_lightbox2_player
andtheme_brightcove_cck_formatter_default
now use the widget settings for dimensions instead of the ugly hack.Please do test and review. I've tested it on a local d6 site and seems to work fine.
Comment #4
Manuel Garcia CreditAttribution: Manuel Garcia commentedHere is a better version of the above patch.
Here is how the function is looking:
Comment #5
Manuel Garcia CreditAttribution: Manuel Garcia commentedLast patch actualy was a bit broken.
This one actualy calls the new function correctly. Please test and review =)
Comment #6
Bill Choy CreditAttribution: Bill Choy commentedThe player_type should be added to the player settings form (where you specify the id/key). A player can only handle one of these parameters at a time. So you can never assign the wrong parameter to the player. And then the code become very clean.
Comment #7
theunraveler CreditAttribution: theunraveler commentedI would suggest marking this as a duplicate of #1990214: Playlists, which covers embedding playlists and includes support for the different embed parameters.
Comment #7.0
theunraveler CreditAttribution: theunraveler commentedUpdated issue summary.
Comment #8
k.dani CreditAttribution: k.dani commentedWe are working on the 7.x version of the module, but as soon as we have chance to check it, we review it.
Comment #9
k.dani CreditAttribution: k.dani commentedComment #10
k.dani CreditAttribution: k.dani commentedWe don’t maintain the Drupal 6 version of the module, but apply patches (if it is in RTBC status) until the stable version of Drupal 8 is released.
Comment #11
jan.mashat CreditAttribution: jan.mashat at Pronovix for BrightCove commented