Skip to main content

r31 has been released

Comments

4 comments

  • Todd Thompson

    I've been unable to use r31. My 'verify' code doesn't seem to fire with it. I can use r30 and all is fine. I've even double-checked by placing a simple alert('test') in the verify function but that fails to fire. Can you see whats wrong?

    I use the verified function to show the submit button when video is ready.

    Below are the relevant code chunks

    {!! HTML::style('https://assets-cdn.ziggeo.com/v2-r31/ziggeo.css') !!}
    {!! HTML::script('https://assets-cdn.ziggeo.com/v2-r31/ziggeo.js') !!}

    My submit button (hidden on page load)

    <button type="submit" class="btn btn-primary  btn-block"  id="sendvideo" name="sendvideo" >Send to Kijiji</button>




            <ziggeorecorder
                ziggeo-custom-covershots
                ziggeo-early-rerecord
                id="ziggeo-recorder"
                ziggeo-manualsubmit="true"
                title="mytitle"
                description="mydescription"
                expiration-days="14">
            </ziggeorecorder>

        
        
        
    <script type="text/javascript">
        
        window.onload=function(){
        document.getElementById("sendvideo").style.display='none';
        }
        
        var app = new ZiggeoApi.V2.Application({
            token:"aXXXXXXXXXXXXXXX",
            webrtc_streaming: true
        });

        ZiggeoApi.Events.on("system_ready", function() {
            var element = document.getElementById('ziggeo-recorder');
            var recorder = ZiggeoApi.V2.Recorder.findByElement(element);
            
            recorder.on('verified', function() {
                document.getElementById("sendvideo").style.display='inline';
                document.getElementById("videotoken").value = "" + recorder.get('video') + "";
              });

        });
    </script>

    0
  • Bane

    I see. There is a small part of code that would need to be switched for everything to work just fine.

    Based on the code I believe that your tests were done over v1-stable/ziggeo.js and v2-r31/ziggeo.js.

    The difference is in the revision, however also in the v1- and v2- file prefix. What happens is that v1 has codes for v1 and v2 while v2- prefixed revisions hold only v2 codes.

    Because of this the v1 code like

    ZiggeoApi.Events.on("system_ready", function() 

    would not work - since v2 does not recognize that v1 code.

    Hope this makes sense, of course lets see the good stuff - the code that will make it work :)

    You have this code:

    var app = new ZiggeoApi.V2.Application({
    token:"aXXXXXXXXXXXXXXX",
    webrtc_streaming: true
    });

    Now we will use it. I suggest changing "app" to "ziggeo_app" or another such name, since that will make it easier to recognize it in the code, especially on more complex projects.

    Also just to mention, "webrtc_streaming" will make uploads faster, however protocol will subject the quality to the network bandwidth. This is one of the implementations related to live recording and playback where that is considered as needed. If you require quality all the time, then I would suggest turning it to false.

    * Just mentioning it since it is good factor to consider.

    OK, now really to the codes :)

    Change the system_ready event into the following code:

        //info: https://ziggeo.com/docs/sdks/javascript/browser-interaction/application-events
        app.on("ready", function() {
            var element = document.getElementById('ziggeo-recorder');
            var recorder = ZiggeoApi.V2.Recorder.findByElement(element);
            
            recorder.on('verified', function() {
                document.getElementById("sendvideo").style.display='inline';
                document.getElementById("videotoken").value = "" + recorder.get('video') + "";
              });

        });

    * As you can see the change is only at the very top, all the rest should be as it was and work just fine.

    This should work now, of course please let us know how it goes :)

    0
  • Todd Thompson

    totally fixed! thank you very much

    0
  • Bane

    Great to hear that Todd :)

    0

Please sign in to leave a comment.