Last modified 14 years ago Last modified on 01/10/09 19:27:28

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=VIDEO_CONTENT_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block



Video content connects an video resource to a frame

  • Video content is a content of a frame representing video.
  • Video resources are resources for video.
  • Video resources have the same information as any other resources plus specific information about the video they are representing.
  • Video content is responsible for returning the visual representation of the video
  • There should be drag and drop support, so video can be dropped onto a frame and a video content is created automatically from them. Video are scaled if they are bigger than the frame they are dropped onto.
  • There should be support for creating a frame with video content by choosing an video file.
  • Video resources should support clipping (in point, out point), rate and volume

Task requirements

  • Define basic video content.
  • Define basic video resource.
  • Define how content work with frames to find a renderer .

Task result

The result of this task should be source code.

Implementation idea

  • Create class VideoContent which is concrete implementation of for video.
  • VideoContent should override mainResource() and return Prop<VideoResource>.
  • Create class VideoResource which is concrete implementation of for video resources.
  • VideoResource should have methods:
    • inPoint
    • outPoint
    • startPoint (0)
    • endPoint (same as duration)
    • rate
    • volume
    • duration
    • poster frame (time code for the frame to use when displaying the video as a still, defaults to 0)
  • Video
    • Video is represented by an image, either the first frame of the video, or the poster frame
    • Video can have a controller
    • Determine if any of this should be part of the content, or kept elsewhere, ie does the content have any say in how the resource is represented on screen?
    • If yes, maybe contents should have extension points that keep the list of renderers for this content (and similar for images and audio, ie any content)

How to demo

  • Create a frame with video resource.
  • Check if the resource is set correctly and check if the information about the resource is correct.
  • Try changing the resource and check again the same things.


  • Make MediaBookResource abstract, add constructors accepting the media as File, make the method doSaveContent working.
  • Remove the code concerned with MediaBookResource from the static method createAppropriateContent of FrameFactory because MediaBookResource is abstract.
  • Remove the code concerned with MediaBookResource from the method create of and because MediaBookResource is abstract.
  • MediaFrameContent should override the mainResource property of FrameContent with template type extending MediaBookResource, mainResource should be abstract.
  • Create interface MediaHandler which is base interface for handlers which are dealing with media it should have a method which returns an InputStream representing the media.
  • Create interface MediaSceneElement which is base interface for all scene elements concerned with media. It should extend SceneElement and it should have handler property with template type extending MediaHandler.
  • Create abstract class MediaContentView which extends ContentView. It should override the element property with template type extending MediaSceneElement and element should remain abstract, it should also override the model property with template type extending MediaFrameContent and it model should remain abstract.
  • Create class VideoResource extending MediaBookResource it should:
    • have constructors to which the video can be passed as File or BinData.
    • the method getResourceKind should return "video-resource".
  • Create class VideoContent extending MediaFrameContent it should:
    • implement the mainResource property of MediaFrameContent with template type VideoResource.
  • Move VideoHandler to org.sophie2.base.scene so that it can be used by VideoSceneElement. Change VideoHandler so that it extends MediaHandler and is empty (for now).
  • Create interface VideoSceneElement extending MediaSceneElement. It is an interface describing a scene element containg video. It should override the handler property of MediaSceneElement with template type VideoHandler.
  • Create class VideoContentView extending MediaContentView it should:
    • implement the model property with template type VideoFrameContent.
    • implement the element property with template type extending VideoSceneElement.
    • the concrete implementation of VideoSceneElement should implement handler as an AutoProperty depending on model.
    • implement VideoHandler so that VideoSceneElement can be implemented.
  • Add code to the static method createAppropriateContent of FrameFactory so that it returns VideoFrameContent if the resource passed to it is of type VideoBookResource.
  • Add code to the method create of and so that it returns VideoBookResource if the Storage passed to it contains "VideoBookResource".



Unit test:



(Write comments for this or later revisions here.)