Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
23 Views

HLS stream/Ajax/InAppBrowser

I need some help,

when using internal browser, hls stream play very well, but can't exec ajax calls, and don't close browser, and with InAppBrowser i can exec ajax calls, can close the browser, can exec executeScript, but hls stream don't play.

any Idea?

=========

            function Kiosk() {
                $("#situacao").html("<center>Acessando o Servidor...</center>");
                var murl = dev.isDeviceReady.url+ 'kiosk';
                var dados = { uuid: dev.isDeviceReady.DeviceUUid, 
                              connection:   dev.isDeviceReady.DeviceConnection, 
                              platform:dev.isDeviceReady.NavPlatform,
                              model:dev.isDeviceReady.DeviceModel, 
                              nr: ++dev.isDeviceReady.nr,
                              idexterno:dev.isDeviceReady.idexterno
                            };
                $.ajax({
                    type: "GET",
                    url: murl,
                    data: dados,
                    crossDomain: true,
                    timeout: 3000,
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    complete: function (jqXHR, textStatus) {
                        data = JSON.parse( jqXHR.response );
                        var definido = (typeof data.resp !== "undefined");
                        console.log("responseCode:"+jqXHR.status + ' ' + definido  );
                        if ((jqXHR.status == 200) || (definido)) {
                           $("#situacao").html("<center>" +  jqXHR.statusText+ "</center>");
                           if (data.resp.modo) {
                               $("#situacao").html("<center>" + data.resp.texto + "</center>");
                               if (!dev.isDeviceReady.isShowMessage){
                                  dev.isDeviceReady.isShowMessage = true;
                                  var urlapp = dev.isDeviceReady.url + 'index.html' ;
                                  // with internal browser hls stream play                                  
                                  delete window.open;
                                  // but ajax,close and executeScript fail
                                  dev.isDeviceReady.ref = window.open(urlapp, '_blank', 'location=no');                                   
                                  dev.isDeviceReady.ref.addEventListener( "loaderror", function() {
                                       console.log('loaderror:');
                                  });
                               } else {
                                 dev.isDeviceReady.ref.executeScript({
                                    code: "sessionStorage.getItem( 'dados' )"
                                 },
                                 function( values ) {
                                    var name = values[ 0 ];
                                    console.log('180:<<<')
                                    if ( name ) {
                                        name = JSON.parse( name );
                                        console.dir(name);
                                    }
                                 });
                               }
                           } else {
                                dev.isDeviceReady.isShowMessage = false;
                                if (dev.isDeviceReady.ref)
                                    dev.isDeviceReady.ref.close();
                                $("#situacao").html("<center>" + data.resp.texto + "</center>");
                           }
                        } else {
                           dev.isDeviceReady.isShowMessage = false;
                           if (dev.isDeviceReady.ref)
                               dev.isDeviceReady.ref.close();
                           $("#situacao").html("<center>  O servidor não conseguiu processar o pedido; Tente novamente mais tarde...</center>");
                        }
                    }
                });
            }
            Kiosk();
            setInterval(function () {
                Kiosk();
            }, 1000 * 10 );

 

Tags (2)
0 Kudos
2 Replies
Highlighted
23 Views

aditional data

using emulation tab, i can't see hls stream, receiveing this message bellow. in debug tab

"Your browser does not support MSE, which is necessary for HTML5 playback. 

Flash Fallback is provided only when Viblast is used in combination with video.js. For more info refer to http://viblast.com/player/docs/videojs-integration"

vrs.: 3357/emulation
(Object) { "ACreq": "Mozilla/5.0 (Linux; Android 4.1.1; Nexus 7 Build/JRO03D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19", "filename": "./vs/index.html" }

vrs.: 3400/emulation
(Object) { "ACreq": "Mozilla/5.0 (Linux; Android 4.1.1; Nexus 7 Build/JRO03D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19", "filename": "./vs/index.html" }

windows 10/chrome
(Object) { "ACreq": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)                AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36", "filename": "./vs/index.html" }

0 Kudos
Highlighted
23 Views

Most AJAX problems have been due to using the jQuery 1 library. Try switching to the jQuery 2 library, see > https://software.intel.com/en-us/xdk/faqs/app-designer#ajax-jquery-one-fail <

I'm curious, why are adding to the dev.isDeviceReady object? That object is created by the xdk/init-dev.js file and it's only purpose is for combining a few ready events to make it easier to start your app at an appropriate moment. I recommend that you not augment it with additional elements.

Regarding the error messages, it looks like you are trying to play a specially formatted video file? Not sure, But searching for that error message brings up a list of items, including > https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats <

0 Kudos