Note: New in Wowza Media Server 3 Preview 3
You can now play a portion of an video on demand file when streaming using HTTP streaming to iOS devices, smooth streaming or Flash HTTP streaming. There are several ways to specify the start time and duration.
- Query parameters: All HTTP streaming protocols now support a playstart and or playduration query parameter. Times are specified in milliseconds. For example to play the sample.mp4 starting at 30 seconds for a duration of 40 seconds to an iOS device, use the URL:
Code:http://[wowza-ip-address]:1935/vod/mp4:sample.mp4?playstart=30000&playduration=40000- Server-side API:You can specify the playStart and playDuration times through the IHTTPStreamerSession session API. Values are in milliseconds. For example in a module you can use the following method:
Code:public void onHTTPSessionCreate(IHTTPStreamerSession httpSession) { httpSession.setPlayStart(30000); httpSession.setPlayDuration(40000); }- SMIL file:In a SMIL file using the begin and dur attributes. These attributes are specified in seconds:
Code:<smil> <head> </head> <body> <switch> <video begin="30.0" dur="40.0" src="mp4:sample.mp4" system-bitrate="450000"/> </switch> </body> </smil>- MediaList API:Using the MediaList API. The values are specified in milliseconds:
Code:public class ModuleAMLSTTest extends ModuleBase implements IMediaListProvider { public void onAppStart(IApplicationInstance appInstance) { appInstance.setMediaListProvider(this); } public MediaList resolveMediaList(IMediaListReader mediaListReader, IMediaStream stream, String streamName) { MediaList mediaList = new MediaList(); MediaListSegment segment = new MediaListSegment(); mediaList.addSegment(segment); MediaListRendition rendition1 = new MediaListRendition(); segment.addRendition(rendition1); rendition1.setName("mp4:sample.mp4"); rendition1.setBitrateAudio(128000); rendition1.setBitrateVideo(400000); rendition1.setWidth(320); rendition1.setHeight(240); rendition1.setPlayStart(30000); rendition1.setPlayDuration(40000); return mediaList; } }
Charlie


Reply With Quote
thanks
