however, the player only plays the second rendition of the medialist segment; I need help. For example: I would like to play the sample.mp4 file for 15 seconds starting from second 20 and second 200. connectUrl: http://[ip address]:1935/vod/amlst:sample.mp4/manifest.f4m
public class ModuleTest implements IMediaListProvider {
public MediaList resolveMediaList(IMediaListReader mediaListReader, IMediaStream stream, String streamName) { double duration = StreamUtils.getStreamLength(stream.getClient().getAppInstance(), streamName); duration = duration*1000;
MediaList mediaList = new MediaList();
if( duration >=300000) { MediaListSegment segment = new MediaListSegment(); mediaList.addSegment(segment);
MediaListRendition rendition1 = new MediaListRendition(); segment.addRendition(rendition1); rendition1.setName(streamName); rendition1.setBitrateAudio(128000); rendition1.setBitrateVideo(400000); rendition1.setWidth(320); rendition1.setHeight(240); rendition1.setPlayStart(20000); rendition1.setPlayDuration(15000); rendition1.setAudioCodecId(“mp4a.40.2”); rendition1.setVideoCodecId(“avc1.66.12”); // second rendition MediaListRendition rendition2 = new MediaListRendition(); segment.addRendition(rendition2);
rendition2.setName(streamName); rendition2.setBitrateAudio(128000); rendition2.setBitrateVideo(400000); rendition2.setWidth(320); rendition2.setHeight(240); rendition2.setPlayStart(200000); rendition2.setPlayDuration(15000); rendition2.setAudioCodecId(“mp4a.40.2”); rendition2.setVideoCodecId(“avc1.66.12”); }
return mediaList;
} }