VP-234: Factor the Video Player to use subcomponents when doing tree creation instead of string based conditional code pathsv

Metadata

Source
VP-234
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Cindy Li
Reporter
Michelle D'Souza
Created
2011-11-30T11:30:17.810-0500
Updated
2013-02-27T10:23:47.404-0500
Versions
  1. 0.1
Fixed Versions
N/A
Component
  1. core

Description

As per the conversation in the IRC channel: http://wiki.fluidproject.org/display/fluid/fluid-work+IRC+Logs-2011-11-29 (starting at roughly [15:34:43 CST(-0600)])

We want to get rid of the conditional code paths based on the strings 'custom' and 'native' and introduce sub components instead.

Comments

  • Cindy Li commented 2012-01-12T10:13:17.219-0500

    The work for this jira should wait on the merge-in of the pull request #10 (https://github.com/fluid-project/videoPlayer/pull/10), which has re-factored the video player with sub-components.

  • Anastasia Cheetham commented 2012-01-26T14:16:13.387-0500

    The current plan (rationale described on-list, at http://lists.idrc.ocad.ca/pipermail/fluid-work/2012-January/008329.html) is:

    1) Convert the VideoPlayer parent component to a viewComponent which will load the template and insert it into the DOM "manually."
    2) Pull the markup for the custom controls out of the main template into a separate template controlled by the "customControls" subcomponent (a rendererComponent)
    3) Create a "nativeControls" subcomponent responsible for modifying the <video> element to add the "controls" attribute necessary for native controls.

    I've started playing with this a bit, but didn't get far at all. Stopping to respond to comments on 4546's pull request.

  • Anastasia Cheetham commented 2012-01-26T16:00:36.880-0500

    We've had a discussion about this in the IRC channel (http://wiki.fluidproject.org/display/fluid/fluid-work+IRC+Logs-2012-01-26), basically confirming this plan, and further clarifying the role of the parent videoPlayer component as an aggregator of three subcomponents:

    1) a 'player strategy'. The default for this will be the current html5 strategy, better factored into its own separate component. This will be swappable with other strategies when playing other video types or using non-html5 browsers.
    2) the controls
    3) the captions

    The subcomponents will have their own templates and be responsible for managing them appropriately.

  • Anastasia Cheetham commented 2012-02-02T11:50:51.216-0500

    My start on this is in a branch in my github: https://github.com/acheetham/videoPlayer/tree/FLUID-4567-subcomponents-for-trees

    I moved responsibility for the controls template out of the main template and into the controllers subcomponent. So now, the controllers subcomponent loads its own template.

    Note that this branch is based off of my FLUID-4546-controllers-refactoring, updated to the latest version as of this morning.

  • Cindy Li commented 2012-02-17T09:43:05.550-0500

    I've started the creation of "nativeControls" component @ https://github.com/cindyli/videoPlayer/tree/FLUID-4567. The more work is needed in this branch to resolve the issue that the controllers container gets displayed even in non-html5 browsers.

    Moreover, the investigation shows that loading the controls template in controllers component could result in the js error being thrown due to the async ajax calls for template loading. A proper way might be implementing a templateLoader sub-component that loads in all the templates at the start of the videoPlayer. This way would also improve the user experience to easy config the template locations.

  • Justin Obara commented 2013-02-27T10:23:47.375-0500

    Removed the direct support of native controls. Rather if an integrator would like them, they would need to remove the rendered controls (e.g. replace with fluid.emptySubcomponent) and add the "controls" property to the template.