use of org.opencastproject.smil.entity.media.container.SmilMediaSequenceImpl in project opencast by opencast.
the class SmilServiceImpl method addSequence.
/**
* {@inheritDoc}
*/
@Override
public SmilResponse addSequence(Smil smil, String parentId) throws SmilException {
SmilMediaContainer seq = new SmilMediaSequenceImpl();
((SmilBodyImpl) smil.getBody()).addMediaElement(seq, parentId);
return new SmilResponseImpl(smil, seq);
}
use of org.opencastproject.smil.entity.media.container.SmilMediaSequenceImpl in project opencast by opencast.
the class SmilServiceImplTest method testAddSequence.
/**
* Test of addSequence methods, of class SmilServiceImpl.
*/
@Test
public void testAddSequence() throws Exception {
SmilResponse smilResponse = smilService.createNewSmil();
smilResponse = smilService.addSequence(smilResponse.getSmil());
assertNotNull(smilResponse.getSmil().getBody().getMediaElements().get(0));
assertEquals(smilResponse.getSmil().getBody().getMediaElements().get(0), smilResponse.getEntity());
assertTrue(smilResponse.getSmil().getBody().getMediaElements().get(0) instanceof SmilMediaSequenceImpl);
SmilMediaContainer par = (SmilMediaContainer) smilResponse.getEntity();
assertTrue(par.isContainer());
assertSame(SmilMediaContainer.ContainerType.SEQ, par.getContainerType());
smilResponse = smilService.addSequence(smilResponse.getSmil(), smilResponse.getEntity().getId());
assertNotNull(smilResponse.getSmil().getBody().getMediaElements().get(0));
assertTrue(smilResponse.getSmil().getBody().getMediaElements().get(0) instanceof SmilMediaSequenceImpl);
SmilMediaContainer parent = (SmilMediaContainer) smilResponse.getSmil().getBody().getMediaElements().get(0);
assertNotNull(parent.getElements().get(0));
assertTrue(parent.getElements().get(0) instanceof SmilMediaSequenceImpl);
assertEquals(parent.getElements().get(0).getId(), smilResponse.getEntity().getId());
// logger.info(((SmilImpl)smilResponse.getSmil()).toXML());
}
Aggregations