Examples of MediaEntryModule


Examples of com.rometools.modules.mediarss.MediaEntryModule

                }
            }
            out.endArray();
        }

        MediaEntryModule mediaEntryModule = (MediaEntryModule) message.getModule(MediaEntryModule.URI);
        if (mediaEntryModule != null) {
            out.startArray(Rss.MEDIAS);
            for (MediaContent mediaContent : mediaEntryModule.getMediaContents()) {
                out.startObject();
                addFieldIfNotNull(out, Rss.Medias.TYPE, mediaContent.getType());

                if (mediaContent.getReference() != null) {
                    URI url = null;
View Full Code Here

Examples of com.sun.syndication.feed.module.mediarss.MediaEntryModule

        if (jsonAuthor == null) {
          jsonAuthor = e.getAuthor();
        }

        JSONObject media = new JSONObject();
        MediaEntryModule mediaModule = (MediaEntryModule) e.getModule(MediaModule.URI);
        if (mediaModule != null) {
          if (mediaModule.getMediaContents().length > 0) {
            JSONArray contents = new JSONArray();

            for (MediaContent c : mediaModule.getMediaContents()) {
              JSONObject content = new JSONObject();

              if (c.getReference() instanceof UrlReference) {
                content.put("URL", ((UrlReference) c.getReference()).getUrl().toString());
              }

              if (c.getType() != null) {
                content.put("Type", c.getType());
              }

              if (c.getWidth() != null) {
                content.put("Width", c.getWidth());
              }

              if (c.getHeight() != null) {
                content.put("Height", c.getHeight());
              }

              contents.put(content);
            }

            media.put("Contents", contents);
          }

          if (mediaModule.getMetadata() != null) {
            if (mediaModule.getMetadata().getThumbnail().length > 0) {
              // "If multiple thumbnails are included, it is assumed that they are in order of importance"
              // Only use the first thumbnail for simplicity's
              // sake

              JSONObject thumbnail = new JSONObject();

              Thumbnail t = mediaModule.getMetadata().getThumbnail()[0];
              thumbnail.put("URL", t.getUrl().toString());

              if (t.getWidth() != null) {
                thumbnail.put("Width", t.getWidth());
              }
View Full Code Here

Examples of com.sun.syndication.feed.module.mediarss.MediaEntryModule

        if (jsonAuthor == null) {
          jsonAuthor = e.getAuthor();
        }

        JSONObject media = new JSONObject();
        MediaEntryModule mediaModule = (MediaEntryModule) e.getModule(MediaModule.URI);
        if (mediaModule != null) {
          if (mediaModule.getMediaContents().length > 0) {
            JSONArray contents = new JSONArray();

            for (MediaContent c : mediaModule.getMediaContents()) {
              JSONObject content = new JSONObject();

              if (c.getReference() instanceof UrlReference) {
                content.put("URL", ((UrlReference) c.getReference()).getUrl().toString());
              }

              if (c.getType() != null) {
                content.put("Type", c.getType());
              }

              if (c.getWidth() != null) {
                content.put("Width", c.getWidth());
              }

              if (c.getHeight() != null) {
                content.put("Height", c.getHeight());
              }

              contents.put(content);
            }

            media.put("Contents", contents);
          }

          if (mediaModule.getMetadata() != null) {
            if (mediaModule.getMetadata().getThumbnail().length > 0) {
              // "If multiple thumbnails are included, it is assumed that they are in order of importance"
              // Only use the first thumbnail for simplicity's
              // sake

              JSONObject thumbnail = new JSONObject();

              Thumbnail t = mediaModule.getMetadata().getThumbnail()[0];
              thumbnail.put("URL", t.getUrl().toString());

              if (t.getWidth() != null) {
                thumbnail.put("Width", t.getWidth());
              }
View Full Code Here

Examples of org.rometools.feed.module.mediarss.MediaEntryModule

            this.generateMetadata(m.getMetadata(), element);
            this.generatePlayer(m.getPlayer(), element);
        }

        if (module instanceof MediaEntryModule) {
            MediaEntryModule m = (MediaEntryModule) module;
            MediaGroup[] g = m.getMediaGroups();

            for (int i = 0; i < g.length; i++) {
                this.generateGroup(g[i], element);
            }

            MediaContent[] c = m.getMediaContents();

            for (int i = 0; i < c.length; i++) {
                this.generateContent(c[i], element);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.