本文整理汇总了Java中org.w3c.dom.smil.SMILMediaElement类的典型用法代码示例。如果您正苦于以下问题:Java SMILMediaElement类的具体用法?Java SMILMediaElement怎么用?Java SMILMediaElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SMILMediaElement类属于org.w3c.dom.smil包,在下文中一共展示了SMILMediaElement类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getMediaElement
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
private static SMILMediaElement getMediaElement(SMILDocument document, PduPart part) {
final String tag;
if (PartParser.isImage(part)) {
tag = "img";
} else if (PartParser.isAudio(part)) {
tag = "audio";
} else if (PartParser.isVideo(part)) {
tag = "video";
} else if (PartParser.isText(part)) {
tag = "text";
} else {
tag = "ref";
}
return createMediaElement(tag, document, new String(part.getName() == null
? new byte[]{}
: part.getName()));
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:18,代码来源:SmilUtil.java
示例2: getMediaModel
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
/**
* Returns the media model for the given SMILMediaElement in the PduBody.
*
* @param context Context
* @param sme The SMILMediaElement to find
* @param srcs String array of sources
* @param layouts LayoutModel
* @param pb PduBuddy
* @return MediaModel
* @throws IOException
* @throws IllegalArgumentException
* @throws MmsException
*/
public static MediaModel getMediaModel(Context context, SMILMediaElement sme,
ArrayList<String> srcs, LayoutModel layouts,
PduBody pb)
throws IOException, IllegalArgumentException, MmsException {
String tag = sme.getTagName();
String src = sme.getSrc();
PduPart part = findPart(context, pb, src, srcs);
if (sme instanceof SMILRegionMediaElement) {
return getRegionMediaModel(
context, tag, src, (SMILRegionMediaElement) sme, layouts, part);
} else {
return getGenericMediaModel(
context, tag, src, sme, part, null);
}
}
开发者ID:moezbhatti,项目名称:qksms,代码行数:33,代码来源:MediaModelFactory.java
示例3: createSmilDocument
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
private static SMILDocument createSmilDocument(PduBody body) {
Log.w(TAG, "Creating SMIL document from PduBody.");
SMILDocument document = new SmilDocumentImpl();
SMILElement smilElement = (SMILElement) document.createElement("smil");
document.appendChild(smilElement);
SMILElement headElement = (SMILElement) document.createElement("head");
smilElement.appendChild(headElement);
SMILLayoutElement layoutElement = (SMILLayoutElement) document.createElement("layout");
headElement.appendChild(layoutElement);
SMILRootLayoutElement rootLayoutElement = (SMILRootLayoutElement) document.createElement("root-layout");
rootLayoutElement.setWidth(ROOT_WIDTH);
rootLayoutElement.setHeight(ROOT_HEIGHT);
layoutElement.appendChild(rootLayoutElement);
SMILElement bodyElement = (SMILElement) document.createElement("body");
smilElement.appendChild(bodyElement);
SMILParElement par = (SMILParElement) document.createElement("par");
bodyElement.appendChild(par);
for (int i=0; i<body.getPartsNum(); i++) {
PduPart part = body.getPart(i);
SMILRegionElement regionElement = getRegion(document, part);
SMILMediaElement mediaElement = getMediaElement(document, part);
if (regionElement != null) {
((SMILRegionMediaElement)mediaElement).setRegion(regionElement);
layoutElement.appendChild(regionElement);
}
par.appendChild(mediaElement);
}
return document;
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:40,代码来源:SmilUtil.java
示例4: createSmilDocument
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
public static SMILDocument createSmilDocument(SlideDeck deck) {
Log.w(TAG, "Creating SMIL document from SlideDeck.");
SMILDocument document = new SmilDocumentImpl();
SMILElement smilElement = (SMILElement) document.createElement("smil");
document.appendChild(smilElement);
SMILElement headElement = (SMILElement) document.createElement("head");
smilElement.appendChild(headElement);
SMILLayoutElement layoutElement = (SMILLayoutElement) document.createElement("layout");
headElement.appendChild(layoutElement);
SMILRootLayoutElement rootLayoutElement = (SMILRootLayoutElement) document.createElement("root-layout");
rootLayoutElement.setWidth(ROOT_WIDTH);
rootLayoutElement.setHeight(ROOT_HEIGHT);
layoutElement.appendChild(rootLayoutElement);
SMILElement bodyElement = (SMILElement) document.createElement("body");
smilElement.appendChild(bodyElement);
SMILParElement par = (SMILParElement) document.createElement("par");
bodyElement.appendChild(par);
for (Slide slide : deck.getSlides()) {
SMILRegionElement regionElement = slide.getSmilRegion(document);
SMILMediaElement mediaElement = slide.getMediaElement(document);
if (regionElement != null) {
((SMILRegionMediaElement)mediaElement).setRegion(regionElement);
layoutElement.appendChild(regionElement);
}
par.appendChild(mediaElement);
}
return document;
}
开发者ID:redcracker,项目名称:TextSecure,代码行数:39,代码来源:SmilUtil.java
示例5: createMediaElement
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
public static SMILMediaElement createMediaElement(
String tag, SMILDocument document, String src) {
SMILMediaElement mediaElement =
(SMILMediaElement) document.createElement(tag);
mediaElement.setSrc(escapeXML(src));
return mediaElement;
}
开发者ID:moezbhatti,项目名称:qksms,代码行数:8,代码来源:SmilHelper.java
示例6: getMediaModel
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
public static MediaModel getMediaModel(Context context,
SMILMediaElement sme, LayoutModel layouts, PduBody pb)
throws IOException, IllegalArgumentException, MmsException {
String tag = sme.getTagName();
String src = sme.getSrc();
PduPart part = findPart(pb, src);
if (sme instanceof SMILRegionMediaElement) {
return getRegionMediaModel(
context, tag, src, (SMILRegionMediaElement) sme, layouts, part);
} else {
return getGenericMediaModel(
context, tag, src, sme, part, null);
}
}
开发者ID:slvn,项目名称:android-aosp-mms,代码行数:16,代码来源:MediaModelFactory.java
示例7: createMediaElement
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
private static SMILMediaElement createMediaElement(String tag, SMILDocument document, String src) {
SMILMediaElement mediaElement = (SMILMediaElement) document.createElement(tag);
mediaElement.setSrc(escapeXML(src));
return mediaElement;
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:6,代码来源:SmilUtil.java
示例8: getMediaElement
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
@Override
public SMILMediaElement getMediaElement(SMILDocument document) {
return SmilUtil.createMediaElement("video", document, new String(getPart().getName()));
}
开发者ID:redcracker,项目名称:TextSecure,代码行数:5,代码来源:VideoSlide.java
示例9: getMediaElement
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
@Override
public SMILMediaElement getMediaElement(SMILDocument document) {
return SmilUtil.createMediaElement("audio", document, new String(getPart().getName()));
}
开发者ID:redcracker,项目名称:TextSecure,代码行数:5,代码来源:AudioSlide.java
示例10: getMediaElement
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
@Override
public SMILMediaElement getMediaElement(SMILDocument document) {
return SmilUtil.createMediaElement("text", document, new String(getPart().getName()));
}
开发者ID:redcracker,项目名称:TextSecure,代码行数:5,代码来源:TextSlide.java
示例11: getMediaElement
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
@Override
public SMILMediaElement getMediaElement(SMILDocument document) {
return SmilUtil.createMediaElement("img", document, new String(getPart().getName()));
}
开发者ID:redcracker,项目名称:TextSecure,代码行数:5,代码来源:ImageSlide.java
示例12: createMediaElement
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
public static SMILMediaElement createMediaElement(String tag, SMILDocument document, String src) {
SMILMediaElement mediaElement = (SMILMediaElement) document.createElement(tag);
mediaElement.setSrc(escapeXML(src));
return mediaElement;
}
开发者ID:redcracker,项目名称:TextSecure,代码行数:6,代码来源:SmilUtil.java
示例13: createSmilDocument
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
private static SMILDocument createSmilDocument(PduBody pb) {
if (Config.LOGV) {
Log.v(TAG, "Creating default SMIL document.");
}
SMILDocument document = new SmilDocumentImpl();
// Create root element.
// FIXME: Should we create root element in the constructor of document?
SMILElement smil = (SMILElement) document.createElement("smil");
smil.setAttribute("xmlns", "http://www.w3.org/2001/SMIL20/Language");
document.appendChild(smil);
// Create <head> and <layout> element.
SMILElement head = (SMILElement) document.createElement("head");
smil.appendChild(head);
SMILLayoutElement layout = (SMILLayoutElement) document.createElement("layout");
head.appendChild(layout);
// Create <body> element and add a empty <par>.
SMILElement body = (SMILElement) document.createElement("body");
smil.appendChild(body);
SMILParElement par = addPar(document);
// Create media objects for the parts in PDU.
int partsNum = pb.getPartsNum();
if (partsNum == 0) {
return document;
}
DrmManagerClient drmManagerClient = QKSMSApp.getApplication().getDrmManagerClient();
boolean hasText = false;
boolean hasMedia = false;
for (int i = 0; i < partsNum; i++) {
// Create new <par> element.
if ((par == null) || (hasMedia && hasText)) {
par = addPar(document);
hasText = false;
hasMedia = false;
}
PduPart part = pb.getPart(i);
String contentType = new String(part.getContentType());
if (ContentType.isDrmType(contentType)) {
contentType = drmManagerClient.getOriginalMimeType(part.getDataUri());
}
if (contentType.equals(ContentType.TEXT_PLAIN)
|| contentType.equalsIgnoreCase(ContentType.APP_WAP_XHTML)
|| contentType.equals(ContentType.TEXT_HTML)) {
SMILMediaElement textElement = createMediaElement(
ELEMENT_TAG_TEXT, document, part.generateLocation());
par.appendChild(textElement);
hasText = true;
} else if (ContentType.isImageType(contentType)) {
SMILMediaElement imageElement = createMediaElement(
ELEMENT_TAG_IMAGE, document, part.generateLocation());
par.appendChild(imageElement);
hasMedia = true;
} else if (ContentType.isVideoType(contentType)) {
SMILMediaElement videoElement = createMediaElement(
ELEMENT_TAG_VIDEO, document, part.generateLocation());
par.appendChild(videoElement);
hasMedia = true;
} else if (ContentType.isAudioType(contentType)) {
SMILMediaElement audioElement = createMediaElement(
ELEMENT_TAG_AUDIO, document, part.generateLocation());
par.appendChild(audioElement);
hasMedia = true;
} else {
// TODO: handle other media types.
Log.w(TAG, "unsupport media type");
}
}
return document;
}
开发者ID:moezbhatti,项目名称:qksms,代码行数:81,代码来源:SmilHelper.java
示例14: getMediaElement
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
@Override
public SMILMediaElement getMediaElement(SMILDocument document) {
return SmilUtil.createMediaElement("other", document, new String(getPart().getName()));
}
开发者ID:Securecom,项目名称:Securecom-Messaging,代码行数:5,代码来源:OtherSlide.java
示例15: createSmilDocument
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
private static SMILDocument createSmilDocument(PduBody pb) {
if (Config.LOGV) {
Log.v(TAG, "Creating default SMIL document.");
}
SMILDocument document = new SmilDocumentImpl();
// Create root element.
// FIXME: Should we create root element in the constructor of document?
SMILElement smil = (SMILElement) document.createElement("smil");
smil.setAttribute("xmlns", "http://www.w3.org/2001/SMIL20/Language");
document.appendChild(smil);
// Create <head> and <layout> element.
SMILElement head = (SMILElement) document.createElement("head");
smil.appendChild(head);
SMILLayoutElement layout = (SMILLayoutElement) document.createElement("layout");
head.appendChild(layout);
// Create <body> element and add a empty <par>.
SMILElement body = (SMILElement) document.createElement("body");
smil.appendChild(body);
SMILParElement par = addPar(document);
// Create media objects for the parts in PDU.
int partsNum = pb.getPartsNum();
if (partsNum == 0) {
return document;
}
DrmManagerClient drmManagerClient = MmsApp.getApplication().getDrmManagerClient();
boolean hasText = false;
boolean hasMedia = false;
for (int i = 0; i < partsNum; i++) {
// Create new <par> element.
if ((par == null) || (hasMedia && hasText)) {
par = addPar(document);
hasText = false;
hasMedia = false;
}
PduPart part = pb.getPart(i);
String contentType = new String(part.getContentType());
if (ContentType.isDrmType(contentType)) {
contentType = drmManagerClient.getOriginalMimeType(part.getDataUri());
}
if (contentType.equals(ContentType.TEXT_PLAIN)
|| contentType.equalsIgnoreCase(ContentType.APP_WAP_XHTML)
|| contentType.equals(ContentType.TEXT_HTML)) {
SMILMediaElement textElement = createMediaElement(
ELEMENT_TAG_TEXT, document, part.generateLocation());
par.appendChild(textElement);
hasText = true;
} else if (ContentType.isImageType(contentType)) {
SMILMediaElement imageElement = createMediaElement(
ELEMENT_TAG_IMAGE, document, part.generateLocation());
par.appendChild(imageElement);
hasMedia = true;
} else if (ContentType.isVideoType(contentType)) {
SMILMediaElement videoElement = createMediaElement(
ELEMENT_TAG_VIDEO, document, part.generateLocation());
par.appendChild(videoElement);
hasMedia = true;
} else if (ContentType.isAudioType(contentType)) {
SMILMediaElement audioElement = createMediaElement(
ELEMENT_TAG_AUDIO, document, part.generateLocation());
par.appendChild(audioElement);
hasMedia = true;
} else {
// TODO: handle other media types.
Log.w(TAG, "unsupport media type");
}
}
return document;
}
开发者ID:slvn,项目名称:android-aosp-mms,代码行数:81,代码来源:SmilHelper.java
示例16: getMediaElement
import org.w3c.dom.smil.SMILMediaElement; //导入依赖的package包/类
public abstract SMILMediaElement getMediaElement(SMILDocument document);
开发者ID:redcracker,项目名称:TextSecure,代码行数:2,代码来源:Slide.java
注:本文中的org.w3c.dom.smil.SMILMediaElement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论