about license key

giapdz

New Member
Hi Max, if i forgot deactivate before uninstall old instance. Now I can't active a new install with this license key. How to active again?
 

Trieuvinh

New Member
Hi Max,
I am using screenshot via your server link demo --> Is ok.
My code js (Attach file). I would like to buy license and have any worried about my code
== > If i buy license then i have to adjust any information in my code ? Please advise!

JavaScript:
//Status constants
var SESSION_STATUS = Flashphoner.constants.SESSION_STATUS;
var STREAM_STATUS = Flashphoner.constants.STREAM_STATUS;
var session;
var PRELOADER_URL = "https://github.com/flashphoner/flashphoner_client/raw/wcs_api-2.0/examples/demo/dependencies/media/preloader.mp4";

//Init Flashphoner API on page load
function init_api() {
    Flashphoner.init({});
    //Connect to WCS server over websockets
    session = Flashphoner.createSession({
        urlServer: "wss://demo.flashphoner.com:8443"
    }).on(SESSION_STATUS.ESTABLISHED, function (session) {
        console.log("ESTABLISHED");
      
        if (Browser.isSafari()) {
            Flashphoner.playFirstVideo(document.getElementById("play"), true, PRELOADER_URL).then(function () {
                playStream();
                //getSnapshot();
                //CHinh()
            });
        } else {
            playStream();
            //getSnapshot();
            //CHinh()
        }
        //Auto end------------------------------------------

        });
    //Snapshot begin-----------------------------------------
    getSnapshot();   
}

//Detect browser
var Browser = {
    isSafari: function () {
        return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
    },
}

function playClick() {
    if (Browser.isSafari()) {
        Flashphoner.playFirstVideo(document.getElementById("play"), true, PRELOADER_URL).then(function () {
            playStream();
        });
    } else {
        playStream();
    }
}

//Playing stream camera IP số 1
function playStream() {
    session.createStream({
        transport: "TCP",
        constraints: {
            audio: true,
            video: {
                width: 640,
                height: 360,
                bitrate: 5000
            }
        },
        name: "rtsp://admin:xxx@xx.xxx.xxx.xxx:555/Streaming/Channels/101/",           
        display: document.getElementById("play"),
    }).play();
}


var Image = "";
function getSnapshot() {
    fetchUrl = "http://demo.flashphoner.com:8081/rest-api/stream/snapshot";
    const options = {
        method: "POST",
        headers: {
            "Content-Type": "application/json"
        },
        body: JSON.stringify({
            "streamName": "rtsp://admin:xxx@xx.xxx.xxx.xxx:555/Streaming/Channels/101/",           
        }),
    }
    fetch(fetchUrl, options)
        .then(function (response) {
            response.json().then(function (data) {
                Image = document.getElementById("snapshotImg").src = "data:image/jpeg;base64," + data.data;
                CHinh();
            });
        });

}


function CHinh() { 
    var nhomdung = "giamdinhcong";
    var socont = "MSCU1111118";
    $.ajax({
        type: 'POST',
        url: 'lane2IP.aspx/Lane2IPSave',
        data: '{ "image" : "' + Image + '", "chuoi_cont": "' + socont + '", "nhom": "' + nhomdung + '"}',
        contentType: 'application/json; charset=utf-8',
        dataType: 'json',
        success: function () {
            //alert("OK");
        },
        error: function (jqXHR, exception) {
            //var msg = 'error';
            //if (jqXHR.status === 0) {
            //    msg = 'Not connect.\n Verify Network.';
            //} else if (jqXHR.status == 404) {
            //    msg = 'Requested page not found. [404]';
            //} else if (jqXHR.status == 500) {
            //    msg = 'Internal Server Error [500].';
            //} else if (exception === 'parsererror') {
            //    msg = 'Requested JSON parse failed.';
            //} else if (exception === 'timeout') {
            //    msg = 'Time out error.';
            //} else if (exception === 'abort') {
            //    msg = 'Ajax request aborted.';
            //} else {
            //    msg = 'Uncaught Error.\n' + jqXHR.responseText;
            //}
            //alert("error:" + msg);
        }
    });
}
 

Max

Administrator
Staff member
Good day.
If i buy license then i have to adjust any information in my code ? Please advise!
You should deploy your own WCS instance and activate a license key: WCS installation and activation. Then, you should register a domain name for your server, buy SSL certificates for your domain and import them to WCS settings: Import SSL certificates using web interface. Finally, you should change the server URL in your code from demo.flashphoner.com to your own domain.
 
Top