Analysis
Overview
In addition to APP_RESOURCE_PREVIEW_DISPLAY_R0 should show first frame of a video resource. In the next revisions for this task there should be controls that allow the user to view the entire movie.
Task requirements
- Implement preview of video resources. It must show the first frame of the video file and act like the image preview for now.
- Integrate this in resource palate.
Task result
- The result should be source code.
Implementation idea
Use APP_RESOURCE_PREVIEW_DISPLAY_R0 for implementation ideas
Related
APP_RESOURCE_PREVIEW_DISPLAY_R0
How to demo
- Import video file inside the application.
- Select a video resource from the resource palette and show the preview
Design
When an user clicks on an element, which is video in the Resources palette, a preview will be shown in the Detail view palette.
For solving this task I will do the following things:
- Add new method in the org.sophie2.base.media.engines.VideoEngine interface called getPreview, with one argument of type org.sophie2.base.media.interfaces.MediaSource;
- Implement this method in org.sophie2.main.media.fobs.JMFEngine;
- Add new extension to sophie's extension point in org.sophie2.main.func.media.MainFuncMediaModule;
- Add new class called org.sophie2.main.func.media.view.VideoContentPreviewProvider, which:
- implements org.sophie2.main.func.resources.ResourcePreviewProvider;
- contains an inner class called VideoResourcePreview, which represents the SwingVisualElement (one JPanel, on which the preview image is drawn) and for that reason it implements SwingVisualElement and extends BaseVisualElement. Here the getPreview method is used for taking the preview image;
- contains one field of type org.sophie2.main.func.media.model.resources.VideoBookResource, which is set through the constructor of VideoResourcePreview.class. This field is used for taking the MediaSource of the concrete video resource, which is an argument of getPreview method.
Implementation
(Describe and link the implementation results here (from the wiki or the repository).)
Testing
(Place the testing results here.)
Comments
(Write comments for this or later revisions here.)