Announcement

Collapse
No announcement yet.

is there a delay on Media Textures?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    is there a delay on Media Textures?

    Hi there it's me again

    I am working alot with the media framework and I found something new to me.
    I have two videos (vidA and vidB) that I want to play at a plane. When vidA is playing and i call an event I change the mediaFileSource, seek to the time vidA was when I switched to vidB.
    When I start the whole process I set the material of the plane to a basic black material, so you can't see the paused video. When the mediaPlayer finished loading and is ready to play I set the material of the plane to the mediaMaterial to see the video.
    Click image for larger version

Name:	seek03.JPG
Views:	1
Size:	258.0 KB
ID:	1204317

    On my Galaxy S3 neo I see maybe two frames of vidA after the material of the plane is set back to the mediaMaterial and then the new video is displayed. I have also tried to delay the set material (mediaMaterila) but it still shows the frames of the wrong video.

    So my question: Is the mediaMaterial updated when it is seen by the player and this causes the first frames to show the wrong movie?
    Or is my setup wrong?

    Hope you can help me with this

    Greetings,
    Evil_Fischi

    #2
    Is Ready will return true immediately after Open on Android but the texture may not have gotten a new frame decoded yet.

    Comment


      #3
      Originally posted by Chris Babcock View Post
      Is Ready will return true immediately after Open on Android but the texture may not have gotten a new frame decoded yet.
      So which node would you recommend to use instead? The "is playing" node? Or would you choose an other workaround?
      I thought the "is ready" node will be true if the video is loaded in the mediaPlayer.

      Comment


        #4
        Android doesn't do an async prepare so Is Ready will be true immediately after Open. Play calls SetRate(1.0) which immediately sets the play state so Is Playing will also return true immediately. The texture is updated once per tick once the native media player provides a decoded frame which will not be necessarily on the first tick (the player has to do some work). I'd try putting a counter on the tick instead of Is Ready() so it has to be in Is Playing for x ticks before you assign the texture to the material.

        Comment

        Working...
        X