Results 1 to 6 of 6

Thread: Retrieve current position from the stream

  1. #1

    Default Retrieve current position from the stream

    I am using the IMediaStreamActionNotify2 interface to trigger events whenever a 'play', 'pause', etc happens on my file-based stream. I can see the methods getting called and going to my logs, but I am not able to get a critical piece of data.

    Namely, if someone has paused or stopped the video, I would like to know at what point/frame/time they paused.

    I have looked at getDataTC, getVideoTC, getMaxTimecode and getLastKeyFrame().getTimecode() and have had no luck. Any help is appreciated.

  2. #2

    Default

    It should be the location value that is passed into the onPause method.

    Charlie

  3. #3
    Join Date
    Dec 2007
    Posts
    25,859

    Default

    For onSeek and onPauseRaw it is "location". For on onPlay it is playStart:

    Code:
    public void onPlay(IMediaStream stream, String streamName, double playStart, double playLen, int playReset) 
    {
    	streamName = stream.getName();
    	getLogger().info("Stream Name: " + streamName);
    }
    		
    public void onPauseRaw(IMediaStream stream, boolean isPause, double location) 
    {
    	getLogger().info("onPauseRaw By: " + stream.getClientId());
    }
    
    public void onSeek(IMediaStream stream, double location)
    {
    	getLogger().info("onSeek");
    }
    Richard

  4. #4

    Default

    That's helpful, but only gets me part way there.

    What about for onStop or if I do the detection during onStreamDestroy? Is there a way to get this from the stream itself?

  5. #5

    Default

    For video on demand I don't think it is accessible through the API.

    Charlie

  6. #6

    Default

    Thanks.

    At least now I know and I can attempt to do some calculations to "guess" based off of the start, pause and seek calls.

Posting Permissions

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