Results 1 to 6 of 6

Thread: Stream Change Live with IHTTPStreamerSession

  1. #1
    Join Date
    Jun 2012
    Posts
    12

    Default Stream Change Live with IHTTPStreamerSession

    Hello guys,

    I'm having some problems:

    First of all i use cupertinostreaming to stream to iOs devices. I also wrote an Module which parses the QueryString to get the login data and connect aswell to a database.
    This is working great. Now I want to kickout a viewer if he is logging in again so that the old session gets killed.
    I'm doing something like this:

    After the User/Password is successfully authenticated i get the cookie value i set before.

    Code:
    List<IHTTPStreamerSession> clients = applicationInstance.getHTTPStreamerSessions();
    Iterator<IHTTPStreamerSession> iter = clients.iterator();
    while(iter.hasNext()) {
               IHTTPStreamerSession client = iter.next();
               String vergleich = client.getCookieStr();
              if(!client.isAcceptSession()|| vergleich == null) 
                                       continue;
              if(vergleich.equals(username)) {
                                     /* DO IT HERE */
                    		getLogger().info((new StringBuilder()).append("Kicke ").append(username).toString());
             }
    }
    if i use rejectSession() the session is simply dropped. But i want that the old (but ACTIVE!!!) connection reset itself and redirect to a vod/livestream which displays that he was logged out.
    Is that even possible? I tried a sessionRedirect but that just end in a stopped stream on the client (which makes sense if the cupertino-proto is not capable of recieving a redirect while playing an stream.)

    I cant kick the user just like that, he needs to know that the session was dropped because of using his credentials twice.
    Or is it maybe possible to inject another ts file and closing the connection after playing that?.
    I'm kind of desperated.

    Thanks in advance!
    Last edited by Teamplaya; 06-27-2012 at 08:24 PM.

  2. #2
    Join Date
    Dec 2007
    Posts
    25,637

    Default

    I can't think of a way to do that.

    Richard

  3. #3
    Join Date
    Jun 2012
    Posts
    12

    Default

    Can you maybe post more informations why you think this is impossible ?
    This is very urgent.!

  4. #4
    Join Date
    Dec 2007
    Posts
    25,637

    Default

    I could be wrong, sorry, there are some methods that look useful. What about this?:

    Code:
    public void onHTTPSessionCreate(IHTTPStreamerSession httpSession) {
    	
    	//httpSession.setRedirectSessionURL("http://[web-server]/404.html");
    	httpSession.redirectSession("http://[web-server]/404.html");
    	httpSession.rejectSession();
    }
    Richard

  5. #5
    Join Date
    Jun 2012
    Posts
    12

    Default

    Hi Richard, thanks for you message.

    But like i told you before:
    If a stream is playing on the clients player, it don't recognizes that there will be a redirect and just stop to play !
    There is no redirect then ....
    I wont kick a user when he is connecting, i want to kickout a old session (redirect him to no access livestream for example) if the user login in again.

    I tried both of httpSession.redirectSession("http://[web-server]/404.html"), httpSession.rejectSession(); .

    rejectSession() works great but it just kills the stream for the user. that is not what i want.
    the redirectSession dont work when its playing. it seems that the redirect just seems to work if the stream is not played (in the beginning of getting the chunks i guess).
    Last edited by Teamplaya; 06-29-2012 at 05:44 AM.

  6. #6
    Join Date
    Dec 2007
    Posts
    25,637

    Default

    Right, if that doesn't work then I don't think it is possible.

    Richard

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •