コード例 #1
0
ファイル: AnnotatedResult.java プロジェクト: nuxeo/samar
 public AnnotatedResult(DocumentModel doc, UriInfo info, String baseURL) {
   this.doc = doc;
   this.uriInfo = info;
   this.baseURL = baseURL;
   this.backofficeURL = URLHelper.documentUrl(doc, baseURL);
   this.translation = new SamarTranslationAdapter(doc);
   if (doc.getType().equals("Video")) {
     videoDocument = doc.getAdapter(VideoDocument.class);
     webmTranscodedVideo = videoDocument.getTranscodedVideo("WebM 480p");
     mp4TranscodedVideo = videoDocument.getTranscodedVideo("MP4 480p");
   } else {
     videoDocument = null;
     webmTranscodedVideo = null;
     mp4TranscodedVideo = null;
   }
 }
コード例 #2
0
ファイル: AnnotatedResult.java プロジェクト: nuxeo/samar
 public List<StoryboardItem> getStoryboard() throws PropertyException, ClientException {
   if (!doc.hasFacet(VideoConstants.HAS_STORYBOARD_FACET)) {
     return Collections.emptyList();
   }
   int size = doc.getProperty(STORYBOARD_PROPERTY).getValue(List.class).size();
   List<StoryboardItem> items = new ArrayList<StoryboardItem>(size);
   StoryboardItem previous = null;
   for (int i = 0; i < size; i++) {
     StoryboardItem next = new StoryboardItem(doc, STORYBOARD_PROPERTY, i, baseURL);
     next.setEndTimecode(String.valueOf(videoDocument.getVideo().getDuration()));
     if (previous != null) {
       previous.setEndTimecode(next.startTimecode);
     }
     items.add(next);
     previous = next;
   }
   return items;
 }