Package org.apache.abdera.ext.media

Examples of org.apache.abdera.ext.media.MediaContent


   
    Abdera abdera = new Abdera();
    Factory factory = abdera.getFactory();
    Entry entry = factory.newEntry();
    MediaGroup group = entry.addExtension(GROUP);
    MediaContent content = group.addExtension(CONTENT);
    content.setUrl("http://example.org");
    content.setBitrate(123);
    content.setChannels(2);
    content.setDuration(123);
    content.setExpression(Expression.SAMPLE);
    content.setFilesize(12345);
    content.setFramerate(123);
    content.setLanguage("en");
    MediaTitle title = content.addExtension(TITLE);
    title.setType(Type.PLAIN);
    title.setText("This is a sample");
   
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    entry.writeTo(out);
View Full Code Here


    @Override
    public int doStartTag() {
        final ServletRequest request = pageContext.getRequest();

        MediaContent content;
        if (request.getAttribute("group") instanceof MediaGroup) {
            MediaGroup group = (MediaGroup) request.getAttribute("group");
            content = group.addExtension(MediaConstants.CONTENT);
        } else {
            Entry entry = getEntry();
            content = entry.addExtension(MediaConstants.CONTENT);
        }
        if (url != null) {
            content.setUrl(url.replaceAll(" ", "%20"));
        }
        if (fileSize != 0) {
            content.setFilesize(fileSize);
        }
        if (type != null) {
            content.setType(type);
        }
        if (medium != null) content.setMedium(Medium.valueOf(medium));
        if (expression != null)
            content.setExpression(Expression.valueOf(expression));
        if (bitrate != 0) content.setBitrate(bitrate);
        if (samplingrate != 0) content.setSamplingRate(samplingrate);
        if (framerate != 0) content.setFramerate(framerate);
        if (channels != 0) content.setChannels(channels);
        if (duration != 0) content.setDuration(duration);
        if (height != 0) content.setHeight(height);
        if (width != 0) content.setWidth(width);

        request.setAttribute("content", content);

        return EVAL_BODY_INCLUDE;
    }
View Full Code Here

        Abdera abdera = new Abdera();
        Factory factory = abdera.getFactory();
        Entry entry = factory.newEntry();
        MediaGroup group = entry.addExtension(GROUP);
        MediaContent content = group.addExtension(CONTENT);
        content.setUrl("http://example.org");
        content.setBitrate(123);
        content.setChannels(2);
        content.setDuration(123);
        content.setExpression(Expression.SAMPLE);
        content.setFilesize(12345);
        content.setFramerate(123);
        content.setLanguage("en");
        MediaTitle title = content.addExtension(TITLE);
        title.setType(Type.PLAIN);
        title.setText("This is a sample");

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        entry.writeTo(out);
View Full Code Here

   
    Abdera abdera = new Abdera();
    Factory factory = abdera.getFactory();
    Entry entry = factory.newEntry();
    MediaGroup group = entry.addExtension(GROUP);
    MediaContent content = group.addExtension(CONTENT);
    content.setUrl("http://example.org");
    content.setBitrate(123);
    content.setChannels(2);
    content.setDuration(123);
    content.setExpression(Expression.SAMPLE);
    content.setFilesize(12345);
    content.setFramerate(123);
    content.setLanguage("en");
    MediaTitle title = content.addExtension(TITLE);
    title.setType(Type.PLAIN);
    title.setText("This is a sample");
   
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    entry.writeTo(out);
View Full Code Here

TOP

Related Classes of org.apache.abdera.ext.media.MediaContent

Copyright © 2018 www.massapicom. 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.