Own videoplayer doesn't trigger the onvideoready event ... sometimes

  • I've tried 1.18 code on an own videoplayer based on javascript interface.
    - First good thing : 1.18 repare a bug on the embedpano onready attribute which is sometime never call with 1.17 but works with the 1.16 and 1.18.
    - Second thing with is my bug : with 1.18 if I change the video (multisource of the same video) with playvideo(url) the onvideoready is sometime called sometimes never (if video has been already loaded or not).
    So I'm obliged to check if isvideoready is true to simulate in a loop the onvideoready event.
    Is it a bug or something that i should do in a true specific order ?

  • Hi,

    - First good thing : 1.18 repare a bug on the embedpano onready attribute which is sometime never call with 1.17 but works with the 1.16 and 1.18.

    I'm not aware about a problem here and nothing had been changed between 1.17 and 1.18 here...?
    Do you have an example?

    - Second thing with is my bug : with 1.18 if I change the video (multisource of the same video) with playvideo(url) the onvideoready is sometime called sometimes never (if video has been already loaded or not).
    So I'm obliged to check if isvideoready is true to simulate in a loop the onvideoready event.
    Is it a bug or something that i should do in a true specific order ?

    Here too - I'm not aware about a problem here - do you have an example?

    Btw - Flash or HTML5?

    And when you say 'own videoplayer' - how exactly do you mean that?
    Do you use the krpano videoplayer plugin or an own one?
    If it's an own one - the onvideoready event will be sent from the plugin itself and not from krpano.

    Best regards,
    Klaus

  • Ok it sould be solved because it seems linked to the video encoding with a bad ratio and a bad encoding.

    In this case the onvideoready event is received only sometimes.

    As you can see the video doesn't have a 2:1 ratio and so on flash player the 360 effect on horizontal axis is broken. But sometimes not after many click to load the video :)

    I send you the project demo files via wetransfert for your own usage and tests.

  • Hi,

    okay - step by step:

    First - there is one problem with your html code here:

    Code
    embedpano(...);
      	 
    var _krpano = document.getElementById("krpanoSWFObject");

    It can't be guaranteed that the Flashplayer and the krpano viewer will be already loaded and be ready directly after the embedpano() call.

    Either do the document.getElementById("krpanoSWFObject") 'later' (e.g. in the loadVideo() function in your case) or use the onready callback to get noticed when krpano would be ready:
    https://krpano.com/docu/html/#onready


    The 'onvideoready' event case is a bug - currently that event was only sent in Flash when the pixel-size of the video would change. This will be fixed in version 1.18.1.


    The problem of the '2:1 ratio' and cut-off video is a Flashplayer-related problem, but I have just found a workaround:
    The Flashplayer itself only reports the real pixel-size of the video - e.g. 1280x720 - and krpano also uses that size for allocating the bitmap buffers for that video. The problem is now when the video was encoded with a non 1:1 pixel-ratio (e.g. like 1.125x1 for a 1440x720 video in your case) - it's not possible to detect that directly in the Flashplayer. And so the Flashplayer will render an automatically up-scaled 1440x720 video into a 1280x720 buffer and so the right part of the video will be cut-off.

    But I have just found a workaround for this case - after some frames of rendering the video, the Flashplayer will switch some internal video variables automatically to the pixel-ratio scaled size - that means by constantly monitoring that sizes there is way a for detecting the scaled size. With version 1.18.1 the videoplayer plugin will detect this now and add automatically an inverse scaling as compensation - then the original 1280x720 source pixels will be rendered unscaled into the 1280x720 buffer and all pixels will be at the right place and krpano will be able to render the pano correctly.


    Generally I would recommend to encode the videos with 1:1 pixel-aspect ratio. There is no advantage of using scaled ratios, there is even more a disadvantage - in HTML5 the browser will upscale the video frame automatically during decoding and then it need to upload more pixels to the GPU as necessary (=slower performance).

    Best regards,
    Klaus

  • For the first step I know it was only for a quick sample on filesystem access.

    Thanks for all others comments and for having a look on my sample.

    Do you have a "kind of date" for the 1.18.1 release ? *rolleyes*

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!