This blog post is part of the documentation for the Silverlight HyperVideo Player Open Source Project
Design Change:
- Create an Interface: IMarkerEventHandler
- Optionally derive a base class MarkerEventHandler that implements the interface
- Instantiate MarkerEventHandler classes that are decoupled from the HyperVideo player
This change is designed to decouple the response to markers in a video from the other responsibilities of the Silverlight HyperVideo player.
[Click on image for full size]
Each MEH encapsulates a strategy for responding to markers.
Here are four examples of how a MEH might interact with markers.
- Heartbeat markers – every n seconds, used as lookups into a data source to see if there is an action at that time
- Synchronization markers – at known times, used to resynchronize, but the logic for what happens at a given time is independent of any marker event
- Meaningful Markers – traditional use of a marker that tells you what time it was raised and identifies what the marker indicates (tied to an event in the video)
- Null marker – the MEH is responsible for whatever we choose but does not depend on markers in the video
There is, potentially, more than one way to have an MEH associated with a HyperVideo player:
Option 1: The HVP will have-a MarkerHandler. As the video is played, if a marker is encountered the HVP will invoke a method on the contained MarkerHandler.
Option 2: (Looser coupled). The application will instantiate a player and a MEH object and when the player encounters a marker it will raise an event to which the MEH will subscribe. If the MEH needs to have the player take an action (e.g., pause or resume) the MEH will fire an event to which the player will subscribe.
These ideas are not fully developed but are thought through enough to move forward and with luck, sufficiently flexible to be easily modified as design emerges. |
Details about the Silverlight HyperVideo Player Project can be found at our CodePlex Site and information on joining the Development effort can be found on the Developer Page within the project documentation.