Examples of MediaField


Examples of org.broadleafcommerce.openadmin.web.form.component.MediaField

                        // We're dealing with a to-one field that wants to be rendered as a dropdown instead of in a
                        // modal, so we'll provision the combo field here. Available options will be set as part of a
                        // subsequent operation
                        f = new ComboField();
                    } else if (fieldType.equals(SupportedFieldType.MEDIA.toString())) {
                        f = new MediaField();
                    } else {
                        // Create a default field since there was no specialized handler
                        f = new Field();
                    }
                   
View Full Code Here

Examples of org.broadleafcommerce.openadmin.web.form.component.MediaField

                            }
                        }
                        if (basicFM.getFieldType() == SupportedFieldType.MEDIA) {
                            field.setValue(entityProp.getValue());
                            field.setDisplayValue(entityProp.getDisplayValue());
                            MediaField mf = (MediaField) field;
                            mf.setMedia(convertJsonToMedia(entityProp.getUnHtmlEncodedValue()));
                        } else if (!SupportedFieldType.PASSWORD_CONFIRM.equals(basicFM.getExplicitFieldType())){
                            field.setValue(entityProp.getValue());
                            field.setDisplayValue(entityProp.getDisplayValue());
                        }
                    }
View Full Code Here

Examples of org.broadleafcommerce.openadmin.web.form.component.MediaField

                staticAssetUrlPrefix = "";
            } else {
                imageUrl = staticAssetUrlPrefix + imageUrl;
            }
           
            MediaField mf = (MediaField) new MediaField()
                .withName("thumbnail")
                .withFriendlyName("Asset_thumbnail")
                .withFieldType(SupportedFieldType.IMAGE.toString())
                .withOrder(Integer.MIN_VALUE)
                .withValue(imageUrl);
           
            // Add a hidden field for the large thumbnail path
            record.getHiddenFields().add(new Field()
                .withName("cmsUrlPrefix")
                .withValue(staticAssetUrlPrefix));
           
            record.getHiddenFields().add(new Field()
                .withName("thumbnailKey")
                .withValue("?smallAdminThumbnail"));
           
            record.getHiddenFields().add(new Field()
                .withName("servletContext")
                .withValue(BroadleafRequestContext.getBroadleafRequestContext().getRequest().getContextPath()));
           
            // Set the height value on this field
            mf.setHeight(operationMap.getNamedOperations().get("smallAdminThumbnail").get("resize-height-amount"));
            record.getFields().add(mf);
           
            // Since we've added a new field, we need to clear the cached map to ensure it will display
            record.clearFieldMap();
        }
View Full Code Here

Examples of org.zoolu.sdp.MediaField

                    AttributeField audioAttribute = (AttributeField) attributesEnum.nextElement();
                   
                    if (initialDescriptor.getMediaDescriptor(Codec.MEDIA_TYPE_AUDIO) == null) {                       
                        log.debug("Creating audio media descriptor." );
                       
                      MediaField mf = new MediaField(Codec.MEDIA_TYPE_AUDIO, audioPort, 0, "RTP/AVP", formatList);
                        initialDescriptor.addMedia(mf, audioAttribute);
                    } else {                       
                        log.debug("Just adding attribute.");
                        initialDescriptor.getMediaDescriptor(Codec.MEDIA_TYPE_AUDIO).addAttribute(audioAttribute);
                    }
                }
               
                String[] commonAudioMediaAttributes = CodecFactory.getInstance().getCommonAudioMediaAttributes();
               
                if (commonAudioMediaAttributes != null) {                   
                    log.debug("Adding " + commonAudioMediaAttributes.length + " common audio media attributes." );
                   
                    for (int attribIndex = 0; attribIndex < commonAudioMediaAttributes.length; attribIndex++) {                       
                        log.debug("Adding common audio media attribute [" + commonAudioMediaAttributes[attribIndex] + "].");
                       
                        AttributeField newAttribute = parseAttributeField(commonAudioMediaAttributes[attribIndex]);
                       
                        if (newAttribute != null) {                           
                            initialDescriptor.getMediaDescriptor(Codec.MEDIA_TYPE_AUDIO).addAttribute( newAttribute);
                        }
                    }
                } else {                   
                    log.debug("No common audio media attributes.");
                }
            }
           
            if (videoCodecsNumber > 0) {               
                Codec[] videoCodecs = CodecFactory.getInstance().getAvailableVideoCodecs();
                Vector<AttributeField> videoAttributes = new Vector<AttributeField>();
               
                for (int videoIndex = 0; videoIndex < audioCodecsNumber; videoIndex++) {                   
                    String payloadId = String.valueOf(videoCodecs[videoIndex].getCodecId());
                    String rtpmapParamValue = payloadId;
                    rtpmapParamValue += " " + videoCodecs[videoIndex].getCodecName();
                    rtpmapParamValue += "/" + videoCodecs[videoIndex].getSampleRate() + "/1";
                   
                    log.debug("Adding rtpmap for payload [" + payloadId + "] with value = [" + rtpmapParamValue + "].");
                   
                    videoAttributes.add(new AttributeField(Codec.ATTRIBUTE_RTPMAP, rtpmapParamValue));                   
                    String[] codecMediaAttributes = videoCodecs[videoIndex].getCodecMediaAttributes();
                   
                    if (codecMediaAttributes != null) {                       
                        log.debug("Adding " + codecMediaAttributes.length + " video codec media attributes.");
                       
                        for (int attribIndex = 0; attribIndex < codecMediaAttributes.length; attribIndex++) {                           
                            log.debug("Adding video media attribute [" + codecMediaAttributes[attribIndex] + "].");
                           
                            AttributeField newAttribute = parseAttributeField(codecMediaAttributes[attribIndex]);
                           
                            if (newAttribute != null) {                               
                                videoAttributes.add(newAttribute);
                            }
                        }
                    } else {
                       log.info("Video codec has no especific media attributes.");
                    }
                }
               
                // Calculate the format list to be used on MediaDescriptor creation.
                String formatList = getFormatList(videoAttributes);
               
                for (Enumeration attributesEnum = videoAttributes.elements(); attributesEnum.hasMoreElements();) {                   
                    AttributeField videoAttribute = (AttributeField) attributesEnum.nextElement();
                   
                    if (initialDescriptor.getMediaDescriptor(Codec.MEDIA_TYPE_VIDEO) == null) {   
                      MediaField mf = new MediaField(Codec.MEDIA_TYPE_VIDEO, audioPort, 0, "RTP/AVP", formatList);
                        initialDescriptor.addMedia(mf, videoAttribute);
                    } else {
                        initialDescriptor.getMediaDescriptor(Codec.MEDIA_TYPE_VIDEO).addAttribute(videoAttribute);
                    }
                }
View Full Code Here

Examples of org.zoolu.sdp.MediaField

                   
                    for (Enumeration attributesEnum = newSdpAttributes.elements(); attributesEnum.hasMoreElements();) {                       
                        AttributeField mediaAttribute = (AttributeField) attributesEnum.nextElement();
                       
                        if (newSdp.getMediaDescriptors().size() == 0) { 
                          MediaField mf = new MediaField(localDescriptor.getMedia().getMedia(),
                                                localDescriptor.getMedia().getPort(),
                                                0, localDescriptor.getMedia().getTransport(),
                                                formatList);
                            newSdp.addMediaDescriptor(new MediaDescriptor(mf, localDescriptor.getConnection()));
                        }
View Full Code Here

Examples of org.zoolu.sdp.MediaField

public class SessionDescriptorUtil {
  public static int getLocalAudioPort(SessionDescriptor localSdp) {
        int localAudioPort = 0;
       
        for (Enumeration e = localSdp.getMediaDescriptors().elements(); e.hasMoreElements();) {
            MediaField media = ((MediaDescriptor) e.nextElement()).getMedia();
            if (media.getMedia().equals("audio")) {
                localAudioPort = media.getPort();
            }
        }
       
        return localAudioPort;
    }
View Full Code Here

Examples of org.zoolu.sdp.MediaField

  public static int getRemoteAudioPort(SessionDescriptor remoteSdp) {
      int remoteAudioPort = 0;

        for (Enumeration e = remoteSdp.getMediaDescriptors().elements(); e.hasMoreElements();) {
            MediaDescriptor descriptor = (MediaDescriptor) e.nextElement();
            MediaField media = descriptor.getMedia();

            if (media.getMedia().equals("audio")) {
                remoteAudioPort = media.getPort();
            }
        }
       
        return remoteAudioPort;
    }
View Full Code Here

Examples of org.zoolu.sdp.MediaField

                    AttributeField audioAttribute = (AttributeField) attributesEnum.nextElement();
                   
                    if (initialDescriptor.getMediaDescriptor(Codec.MEDIA_TYPE_AUDIO) == null) {                       
//                        log.debug("Creating audio media descriptor." );
                       
                      MediaField mf = new MediaField(Codec.MEDIA_TYPE_AUDIO, audioPort, 0, "RTP/AVP", formatList);
                        initialDescriptor.addMedia(mf, audioAttribute);
                    } else {                       
//                        log.debug("Just adding attribute.");
                        initialDescriptor.getMediaDescriptor(Codec.MEDIA_TYPE_AUDIO).addAttribute(audioAttribute);
                    }
                }
               
                String[] commonAudioMediaAttributes = CodecFactory.getInstance().getCommonAudioMediaAttributes();
               
                if (commonAudioMediaAttributes != null) {                   
//                    log.debug("Adding " + commonAudioMediaAttributes.length + " common audio media attributes." );
                   
                    for (int attribIndex = 0; attribIndex < commonAudioMediaAttributes.length; attribIndex++) {                       
//                        log.debug("Adding common audio media attribute [" + commonAudioMediaAttributes[attribIndex] + "].");
                       
                        AttributeField newAttribute = parseAttributeField(commonAudioMediaAttributes[attribIndex]);
                       
                        if (newAttribute != null) {                           
                            initialDescriptor.getMediaDescriptor(Codec.MEDIA_TYPE_AUDIO).addAttribute( newAttribute);
                        }
                    }
                } else {                   
                    log.debug("No common audio media attributes.");
                }
            }
           
            if (videoCodecsNumber > 0) {               
                Codec[] videoCodecs = CodecFactory.getInstance().getAvailableVideoCodecs();
                Vector videoAttributes = new Vector();
               
                for (int videoIndex = 0; videoIndex < audioCodecsNumber; videoIndex++) {                   
                    String payloadId = String.valueOf(videoCodecs[videoIndex].getCodecId());
                    String rtpmapParamValue = payloadId;
                    rtpmapParamValue += " " + videoCodecs[videoIndex].getCodecName();
                    rtpmapParamValue += "/" + videoCodecs[videoIndex].getSampleRate() + "/1";
                   
//                    log.debug("Adding rtpmap for payload [" + payloadId + "] with value = [" + rtpmapParamValue + "].");
                   
                    videoAttributes.add(new AttributeField(Codec.ATTRIBUTE_RTPMAP, rtpmapParamValue));                   
                    String[] codecMediaAttributes = videoCodecs[videoIndex].getCodecMediaAttributes();
                   
                    if (codecMediaAttributes != null) {                       
//                        log.debug("Adding " + codecMediaAttributes.length + " video codec media attributes.");
                       
                        for (int attribIndex = 0; attribIndex < codecMediaAttributes.length; attribIndex++) {                           
//                            log.debug("Adding video media attribute [" + codecMediaAttributes[attribIndex] + "].");
                           
                            AttributeField newAttribute = parseAttributeField(codecMediaAttributes[attribIndex]);
                           
                            if (newAttribute != null) {                               
                                videoAttributes.add(newAttribute);
                            }
                        }
                    } else {
                       log.info("Video codec has no especific media attributes.");
                    }
                }
               
                // Calculate the format list to be used on MediaDescriptor creation.
                String formatList = getFormatList(videoAttributes);
               
                for (Enumeration attributesEnum = videoAttributes.elements(); attributesEnum.hasMoreElements();) {                   
                    AttributeField videoAttribute = (AttributeField) attributesEnum.nextElement();
                   
                    if (initialDescriptor.getMediaDescriptor(Codec.MEDIA_TYPE_VIDEO) == null) {   
                      MediaField mf = new MediaField(Codec.MEDIA_TYPE_VIDEO, audioPort, 0, "RTP/AVP", formatList);
                        initialDescriptor.addMedia(mf, videoAttribute);
                    } else {
                        initialDescriptor.getMediaDescriptor(Codec.MEDIA_TYPE_VIDEO).addAttribute(videoAttribute);
                    }
                }
View Full Code Here

Examples of org.zoolu.sdp.MediaField

                   
                    for (Enumeration attributesEnum = newSdpAttributes.elements(); attributesEnum.hasMoreElements();) {                       
                        AttributeField mediaAttribute = (AttributeField) attributesEnum.nextElement();
                       
                        if (newSdp.getMediaDescriptors().size() == 0) { 
                          MediaField mf = new MediaField(localDescriptor.getMedia().getMedia(),
                                                localDescriptor.getMedia().getPort(),
                                                0, localDescriptor.getMedia().getTransport(),
                                                formatList);
                            newSdp.addMediaDescriptor(new MediaDescriptor(mf, localDescriptor.getConnection()));
                        }
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.