use of org.apache.poi.hslf.record.ExVideoContainer in project poi by apache.
the class MovieShape method getPath.
/**
* @return UNC or local path to a video file
*/
@SuppressWarnings("resource")
public String getPath() {
ExObjRefAtom oe = getClientDataRecord(RecordTypes.ExObjRefAtom.typeID);
int idx = oe.getExObjIdRef();
HSLFSlideShow ppt = getSheet().getSlideShow();
ExObjList lst = (ExObjList) ppt.getDocumentRecord().findFirstOfType(RecordTypes.ExObjList.typeID);
if (lst == null) {
return null;
}
Record[] r = lst.getChildRecords();
for (int i = 0; i < r.length; i++) {
if (r[i] instanceof ExMCIMovie) {
ExMCIMovie mci = (ExMCIMovie) r[i];
ExVideoContainer exVideo = mci.getExVideo();
int objectId = exVideo.getExMediaAtom().getObjectId();
if (objectId == idx) {
return exVideo.getPathAtom().getText();
}
}
}
return null;
}
Aggregations