Closed (fixed)
Project:
Ooyala
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
16 Dec 2010 at 05:05 UTC
Updated:
19 May 2011 at 15:21 UTC
Jump to comment: Most recent file
Right now the theme_ooyala_player() function hardcodes the call to player.js and the $_GET parameters that are passed to it. As a result in order to just add a single parameter to the call you have to override the whole function.
I propose passing the different $_GET parameters to the theme function as an array and then converting the array to the $_GET query string used with the player.js call.
I think that this will also help cleanup some of our theme_ functions which are starting to get really complicated function signatures, and will just continue to get more and more complex as we start making use of additional Ooyala Player API features.
Comments
Comment #1
eojthebraveAnd ... here's a first stab at this. I think these changes are a nice cleanup and will also make it easier to deal with this issue #962432: Implement the Player Authorization API in either a separate module or simply via the theme layer.
Comment #2
quicksketchThis sounds like a good idea to me, you never know what parameters people are going to need. I'd like to see this code moved out of theme functions and into ooyala_player():
That'd make for less redundant code to override in the theme layer.
Also a nice way of writing something like this:
Could be switched to:
Comment #3
eojthebraveMoved the $params stuff into the ooyala_player() function and cleaned up formatting for setting default values.
I also removed the $player_id argument from a number of functions since it was just being used to set $params['playerId'] anyway. You can still manually set it to whatever you want and this simplifies our function signatures even further.
With this change in place we'll probably want to recommend that people who want to manually display a video use the ooyala_player() function and not call theme_ooyala_player directly.
Comment #4
quicksketchThis looks pretty good. What's the reason for passing in $video_data here when we're not using it? I suppose I'm also not clear on if $video_data is the value stored in CCK or if it's what's been retrieved from Ooyala directly.
Comment #5
eojthebrave$video_data contains the length and status information pulled from Ooyala. It's not really necessary, and like you said we're not using it, but it may be information that someone may want to make use of in their theme. I'm cool with just removing it though as there are other ways to get at the data if necessary.
Comment #6
eojthebraveWithout $video_data.
Comment #7
deviantintegral commentedThe patch in #6 looks good to me. I rerolled it against master, and split it into 3 commits.
Comment #8
deviantintegral commentedI've committed the commits from #7.