use of org.opencastproject.smil.entity.media.container.SmilMediaParallelImpl in project opencast by opencast.
the class SmilServiceImpl method addParallel.
/**
* {@inheritDoc}
*/
@Override
public SmilResponse addParallel(Smil smil, String parentId) throws SmilException {
SmilMediaContainer par = new SmilMediaParallelImpl();
((SmilBodyImpl) smil.getBody()).addMediaElement(par, parentId);
return new SmilResponseImpl(smil, par);
}
use of org.opencastproject.smil.entity.media.container.SmilMediaParallelImpl in project opencast by opencast.
the class SmilServiceImplTest method testFromXml.
/**
* Test of fromXml methods, of class SmilServiceImpl.
*/
@Test
public void testFromXml() throws Exception {
SmilResponse smilResponse = smilService.fromXml(TEST_SMIL);
assertNotNull(smilResponse.getSmil());
Smil smil = smilResponse.getSmil();
// test head
assertSame(2, smil.getHead().getParamGroups().size());
// test body
assertSame(2, smil.getBody().getMediaElements().size());
assertTrue(smil.getBody().getMediaElements().get(0) instanceof SmilMediaParallelImpl);
assertTrue(smil.getBody().getMediaElements().get(1) instanceof SmilMediaParallelImpl);
SmilMediaContainer par = (SmilMediaContainer) smil.getBody().getMediaElements().get(0);
assertSame(2, par.getElements().size());
assertTrue(par.getElements().get(0) instanceof SmilMediaVideoImpl);
assertTrue(par.getElements().get(1) instanceof SmilMediaAudioImpl);
}
use of org.opencastproject.smil.entity.media.container.SmilMediaParallelImpl in project opencast by opencast.
the class SmilServiceImplTest method testAddParallel.
/**
* Test of addParallel methods, of class SmilServiceImpl.
*/
@Test
public void testAddParallel() throws Exception {
SmilResponse smilResponse = smilService.createNewSmil();
smilResponse = smilService.addParallel(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 SmilMediaParallelImpl);
SmilMediaContainer par = (SmilMediaContainer) smilResponse.getEntity();
assertTrue(par.isContainer());
assertSame(SmilMediaContainer.ContainerType.PAR, par.getContainerType());
smilResponse = smilService.addParallel(smilResponse.getSmil(), smilResponse.getEntity().getId());
assertNotNull(smilResponse.getSmil().getBody().getMediaElements().get(0));
assertTrue(smilResponse.getSmil().getBody().getMediaElements().get(0) instanceof SmilMediaContainer);
SmilMediaContainer parent = (SmilMediaContainer) smilResponse.getSmil().getBody().getMediaElements().get(0);
assertNotNull(parent.getElements().get(0));
assertTrue(parent.getElements().get(0) instanceof SmilMediaParallelImpl);
assertEquals(parent.getElements().get(0).getId(), smilResponse.getEntity().getId());
}
Aggregations