How to control access to an iPhone/iPod touch stream

https://www.wowza.com/docs/how-to-control-access-to-apple-hls-streaming-cupertinostreaming

I was wondering if there is anyway to remap URI for CupertinoStreaming? I tried this code, but WMS still attempts to access the original URI :

	public void onHTTPCupertinoStreamingSessionCreate(
			HTTPStreamerSessionCupertino httpCupertinoStreamingSession) {
		getLogger().info(
				"onHTTPCupertinoStreamingSessionCreate: "
						+ httpCupertinoStreamingSession.getSessionId());
		String uri = httpCupertinoStreamingSession.getUri();
		String ua = httpCupertinoStreamingSession.getUserAgent();
		String qs = httpCupertinoStreamingSession.getQueryStr();
		getLogger().info("CS URI : " + uri);
		getLogger().info("CS UA : " + ua);
		getLogger().info("CS QS : " + qs);
		if (uri.startsWith("vod/mp4:HHIP")) {
			getLogger().info("Remapping URI");
			httpCupertinoStreamingSession.setUri("vod/mp4:videofile.mp4/playlist.m3u8");
			uri = httpCupertinoStreamingSession.getUri();
			getLogger().info("new CS URI : " + uri);
		} else {
			// reject direct request
			httpCupertinoStreamingSession.rejectSession();
			getLogger().info("Direct request rejected.");
		}
	}

You can use the IMediaStreamNameAliasProvider2 interface.

Richard

This is not possible at present. Maybe in a future release, but I don’t have an eta.

Richard

There is according to quinone that works in iOS 4.2, and is discussed here, with link to apple developer article.

https://www.wowza.com/forums/showthread.php?p=50571

But it doesn’t involve Wowza, I haven’t tried it and wouldn’t be able to help anymore than pointing to the above thread.

Richard

Could you please advice me how to set IPhone start stream position, so video wold start not from the beginning. I use queryParams in the link to specify video start time.

public void onHTTPCupertinoStreamingSessionCreate(HTTPStreamerSessionCupertino cupertinoSession) {
        String timePosition = "timePosition";
        String queryStr = cupertinoSession.getQueryStr();
        getLogger().info("query string: " + queryStr);
        Map<String, String> queryMap = getQueryMap(queryStr);
        String timePosition = queryMap.get(timePosition);
        getLogger().info("TIME POSITION = " + timePosition);
        cupertinoSession.acceptSession();
        cupertinoSession.setStreamPosition(5000);
    }
private Map<String, String> getQueryMap(String query) {
        String[] params = query.split("&");
        Map<String, String> map = new HashMap<String, String>();
        for (String param : params)  {
            String name = param.split("=")[0];
            String value = param.split("=")[1];
            map.put(name, value);
        }
        return map;
    }

Time position changes but the video starts from the beginning.

Is there any kind of workaround like stream.seek() for cupertino stream?

Anyway, thanks