Statistics and analytics data transmission from V7 players to on-premise Kaltura server

Hello @jess,

In HTML5 players (V2, generated by Universal studio), we transmit stats and analytics data to our kaltura server by using UI variable (Kaltura.StatsUrl) in the studio.
Similarly, we want OVP players (V7, generated by TV platform studio) to transmit the stats and analytics data to our Kaltura server.

Similar to universal studio UI variables, we have defined “Kaltura.StatsUrl” and “Kaltura.StatsServiceUrl” parameters in “Advanced Settings” of the TV platform studio.
But, the stats and analytics data are transmitted to “stats.kaltura.com” and “analytics.kaltura.com”.

Is it possible to set the destination of stats and analytics data for the OPV players?

Regards,

Hello @t-saito ,

You can control the analytics endpoint to be used by setting analyticsServiceUrl in the embed code, like so:

<script type="text/javascript">
    try {
        env = {
          serviceUrl: "https://api.example.com/api_v3", // that's the API endpoint
          cdnUrl: "https://cdn.example.com", // CDN
          analyticsServiceUrl: "https://analytics.zj.com" // analytics endpoint
        };
        var config = {
            "targetId": "kplayer",
            "playback": {
                "autoplay": true,
            },
            "provider": {
                "partnerId": "",
                "uiConfId": "",
                env: env
            }
        };
        var kalturaPlayer = PathKalturaPlayer.setup(config);
        kalturaPlayer.loadMedia({
            playlistId: ""
        });
    } catch (e) {
        console.error(e.message)
    }
</script>

For reference, see kaltura-player-js/plugins-config.js at 8c5a6c76e8895166339c6b82b2022b7a45b25199 · kaltura/kaltura-player-js · GitHub

Cheers,

The config for the player is taken from the server environment config, for both old and new player, so in general if your platform is onPrem you should set your kconf config so it generates your config urls to point to your domain.
This way you wouldn’t need to set it in your embed code on every page you use it and the player will pull the data through the embedPlaykit action that queries the kconf to get all of the env config.

I tried the following two methods:
(1) write parameters in “Advanced Settings” of TV platform studio.
(2) write parameters in embed code.

Both methods enabled “cdnUrl” and “serviceUrl”, but not “analyticsServiceUrl”.
Even when I set the “analyticsServiceUrl” to specific URL, analayics queries were transmitted to “analytics.kaltura.com”.

Regards,

Hello @t-saito ,

What version of the player are you using? Would it be possible to share a link to a sample embed?

Thanks,

Hello @jess, @oren_melamed,

Thank you for your reply.

We use the Kaltura CE 14.18.0 (kaltura-player-js 0.40.15).
For a few days after setting the player parameters, access to “analytics.kaltura.com” was occurred.
Currently, the player parameter values are reflected normally.
OVP player accesses to our site.

We are currently facing other problem about the kaltura-player-js.
I have Kaltura 16.14.0 and 16.15.0 all-in-one servers for testing.
At both systems, OVP playes are not displayed.
There is one point to worry about.
In both systems, access to the URL shown below occurs, followed by a “404 not found” error.

https://myhost.mydomain/p/102/embedPlaykitJs/uiconf_id/23448174/versions/kaltura-ovp-player=1.2.1/langs/en,de,fr,es,it,nl,ru,pt_br,ja,zh_cn,zh_tw,hi_in,ar

There eixsts “/opt/kaltura/html5/html5lib/playkitSources/kaltura-ovp-player/1.2.1”, and “/opt/kaltura/playkit-js-bundle-builder/” directories.

Regards,

Hello @t-saito ,

Is the kaltura-playkit-bundler running? If not, please start it. Otherwise, please edit /opt/kaltura/playkit-js-bundle-builder/config/default.json and set:

"debugEnabled": 1

Then try to load a v3 player and check the logs under /opt/kaltura/playkit-js-bundle-builder/log. I’ll be able to guide you further based on your findings.

Thanks,

Hello @jess,

Thank you for your reply.
The “kaltura-playkit-bundler” is running.
I set the parameter “debugEnabled”, and found the following error.

# more kaltura_bundle_builder.log
[1795][2021/03/26 16:56:55][BundleBuilderApi._startServer] INFO:

_____________________________________________________________________________________________
[1795][2021/03/26 16:56:55][BundleBuilderApi._startServer] INFO: Bundle-Builder-Server v1.0.0 started
[1795][2021/03/26 16:56:55][BundleBuilderApi._startHttpServer] INFO: Listening on port [8880]
[1795][2021/03/26 16:56:55][BundleBuilderApi._startHttpsServer] INFO: Listening on port [8889]
[1795][2021/03/26 16:58:35][Object.access] INFO: Request [05713f04-8fe2-479f-872a-95499c30ff32] Remote IP for incoming r
equest is [127.0.0.1]
[1795][2021/03/26 16:58:35][/opt/kaltura/playkit-js-bundle-builder/lib/BundleBuilderApi.js:107:31] INFO: Bundle id: 2_a9
799488597230a862748da5e63da602
dest: undefined
config: eydrYWx0dXJhLW92cC1wbGF5ZXInOicxLjIuMScsJ3BsYXlraXQta2F2YSc6JzEuMS4xJ30=
[1795][2021/03/26 16:58:35][/opt/kaltura/playkit-js-bundle-builder/lib/BundleBuilderApi.js:111:39] INFO: Bundle id: 2_a9
799488597230a862748da5e63da602 - build error!!!
err: Error: Command failed: gulp build --silent --gulpfile /opt/kaltura/playkit-js-bundle-builder/lib/../gulpfile.js --n
ame 2_a9799488597230a862748da5e63da602 --config "eydrYWx0dXJhLW92cC1wbGF5ZXInOicxLjIuMScsJ3BsYXlraXQta2F2YSc6JzEuMS4xJ30
=" --dest undefined --source L29wdC9rYWx0dXJhL2h0bWw1L2h0bWw1bGliL3BsYXlraXRTb3VyY2Vz
internal/modules/cjs/loader.js:550
    throw err;
    ^

Error: Cannot find module '../'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.Module._load (internal/modules/cjs/loader.js:475:25)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/gulp/bin/gulp:13:15)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)

elapsed time: 406ms

Regards,

Hi @t-saito ,

Could you try re-running the code for the %post scriptlet?

cd /opt/kaltura/playkit-js-bundle-builder && rm -rf /opt/kaltura/playkit-js-bundle-builder/node_modules && yarn remove gulp ; npm remove gulp 
npm install yarn forever -g && yarn install && yarn add gulp@3.9.1 && yarn add global  forever gulp@3.9.1
/sbin/chkconfig --add kaltura-playkit-bundler
if [ -r /opt/kaltura/app/configurations/local.ini ];then
	SALT=`grep remote_addr_header_salt /opt/kaltura/app/configurations/local.ini|sed 's@^remote_addr_header_salt\s*=\s*\(.*\)$@\1@g'| sed 's@"@@g'`
	sed -i "s#@APP_REMOTE_ADDR_HEADER_SALT@#$SALT#g" /opt/kaltura/playkit-js-bundle-builder/config/default.json
	service kaltura-playkit-bundler restart
fi

Also, what NodeJS version are you running?

Thanks,

Hello @jess,

I executed posted script.
Then, I found the same error in “kaltura_bundle_builder.log”.
And, I found the following error.

# more bundle-builder-server.log
_http_outgoing.js:747
      throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'first argument',
      ^

TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string or Buffer
    at ServerResponse.end (_http_outgoing.js:747:13)
    at ServerResponse.response.end (/opt/kaltura/playkit-js-bundle-builder/lib/utils/KalturaLogger.js:235:25)
    at /opt/kaltura/playkit-js-bundle-builder/lib/BundleBuilderApi.js:112:46
    at ChildProcess.exithandler (child_process.js:280:5)
    at ChildProcess.emit (events.js:180:13)
    at maybeClose (internal/child_process.js:936:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
    at Process.onexit (/opt/kaltura/playkit-js-bundle-builder/node_modules/async-listener/glue.js:188:31)
error: Forever detected script exited with code: 1
error: Script restart attempt #1

Our testing server employs the following software:

CentOS Linux release 7.9.2009 (Core)
PHP 7.2.34
Kaltura CE 16.14.0
Nodejs v9.11.2
npm 5.6.0

Regards,