Changes between Version 1 and Version 2 of Ticket #1048


Ignore:
Timestamp:
11/06/10 16:12:30 (3 years ago)
Author:
jeroen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1048

    • Property Component changed from to general
    • Property Milestone changed from Player 6.0 to Player 5.5
    • Property Type changed from bug to enhancement
    • Property Summary changed from Refactor custom buttons to Refactor addButton()
  • Ticket #1048 – Description

    v1 v2  
    1 This ticket contains ideas for the refactoring of custom controlbar / dock buttons in the 6.x player: 
     1Rewrite of the dock/controlbar addButton() mechanism that: 
    22 
    3 === Bugs/Enhancements ===  
     3 * Works for Flash + HTML5 
     4 * Enhances current features 
     5 * Remains backward compatible 
    46 
    5 A couple of issues/limitations of the current addButton functionality, plus some ideas for improvements: 
     7=== Mechanism === 
    68 
    7  * In the 5.x API the addButton/removeButton functionality cannot be used to present ''toggles''. When calling the ''remove'' and then the ''add'', an updated button will not display. It is easier to have access to the button icon itself, so that can be updated. The callback handler generally doesn't change with toggles.  
    8  * Rollovers are currently not supported, for neither controlbar nor dock buttons. 
    9  * Controlbar buttons are positioned differently from ''regular'' controlbar buttons in that they are assigned a certain amount of padding. This prevents the creation of custom buttons for e.g. the '''Bekle''' skin. In a refactored API, this padding should be removed. 
    10  * Dock buttons are hard to style, because the plugin / skin has no control over the text that's added to it. It is better to discard the texts,  requiring plugin developers to incorporate this text into the button graphics. That way, plugin developers / skin designers have far more control over their dock buttons. 
     9Example call using the dock (the controlbar can also be used): 
    1110 
    12 === Dropdowns === 
    1311 
    14 In addition to this, we should investigate the possibility of adding dropdown menus. In other words: someone clicking the button is presented with a dropdown instead of a toggle.  
     12{{{ 
     13player.getPlugin("dock").setButton( 
     14 id:String, 
     15 handler:Function, 
     16 outGraphic:String, 
     17 overGraphic:String=null 
     18); 
     19}}} 
    1520 
    16 The question is whether dropdowns would be useful, or whether it is always better to present a dialog window when clicking the button. Some cases: 
     21Explanation of the parameters: 
    1722 
    18  * Bitrate switching: one could present a dropdown with options (''320p'', ''480p'', ''720p'', ''auto''). One could also pop up a dialog with some additional info about bitrate switching (some more help, plus the qualitymonitor settings). 
    19  * Closed captions: one could present a dropdown with options (''english'', ''spanish'', ''disabled''). One could also pop up a dialog in which these settings can be made, as well as options to change the fontsize / background, or download the captions. 
     23 * '''id''': Identifier of the button. If a button with an existing id is used, the button is replaced. 
     24 * '''handler''': Javascript function that is executed when the button is clicked. 
     25 * '''outGraphic''': URL to the button graphic image (preferably PNG b/c of its transparency). Plugins will generally want to skin this. 
     26 * '''overGraphic''': URL to the button graphic image when the mouse is over the button. If not provided, there's no rollover. 
    2027 
    21 A pro of dropdown menus is that they are fairly small UI wise, and don't require a click. A con is that they don't work in mobile devices (rollover) and that they'd probably only work for controlbar icons (not dock icons). 
     28=== Enhancements === 
     29 
     30This setButton() call contains several enhancements over the current AS3 addButton() function. 
     31 
     32 * Buttons are not colorized anymore by the skin. This fixes *wash out* colorizing issues. 
     33 * Buttons can be replaced by calling setButton() with the same id. This allows for (multi)toggles. 
     34 * The PNG is the whole button, not just the icon part. This allows for more flexible skinning (no more margin). 
     35 * Dock buttons contain just the icon, not the icon+text combo. This allows for more flexible skinning (control over text). 
     36 
     37=== Compatibility === 
     38 
     39By using a different function name, this feature can remain compatible with the AS3 addButton(). Inside Flash, this call can probably re-use much of the AS3 code. 
     40 
     41Since the mechanism produces fairly different results as the AS3 addButton(), we do not introduce it in the AS3 API now (perhaps in 6.0?).