Old Kaltura HTML5 Player V2.11 > PHP Warning: Invalid UTF-8 sequence in argument PHP

Hi Jess,

I wonder if you have seen the PHP warning bellow. I appreciate your time and effort. Thanks, Dmitri

Kaltura 9.18
MySQL 5.66
PHP 5/3/3

[error] [client 10.10.10.1] PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in /client/kaltura/web/html5/html5lib/v2.11/includes/MwEmbedMediaWikiStubs.php on line 238, referer: https://video.domain.ca/html5/html5lib/v2.11/mwEmbedFrame.php/p/101/uiconf_id/23448245/entry_id/0_q3a6niap?wid=_101&iframeembed=true&playerId=kaltura_player_1475764887&entry_id=0_q3a6niap

Hello @astrava,

I haven’t but I can see you’re using a very old version of the player [v2.11]. The current stable is v2.69.5. I suggest you upgrade and re-test.

Thank you for your kind reply. I found the link.

https://knowledge.kaltura.com/faq/how-update-kaltura-player-v2

Upgrading the Kaltura Player version Library:

You can also change the player configuration manually and force a specific player to use the new Kaltura HTML5 Player V2 version. Use this option when the Upgrade to New Player option is not offered Kaltura (in the Universal studio). You will need to change the player UI Configuration.

Set up and Configure Kaltura V2 Library

Updating to the Kaltura HTML5 Player V2 is an easy operation and requires a few simple steps. This document applies for all releases but for ease of reading we will use v2.23. You can replace the version number with any current version at the time of reading.

Download HTML5 Player for older version of Kaltura Platform

If your Kaltura Platform version is older and doesn’t include the HTML5 studio, then the method above is not good for you and you need to change KMC configuration and re-deploy the KMC.
Check your KMC version in the base.ini configuration file. The KMC version is defined at kmc_version config.
vim /opt/kaltura/app/configurations/base.ini
This post applies for all KMC versions, but for ease of reading we will use v5.37.17.
Open the configuration file of the KMC.
vim /opt/kaltura/web/flash/kmc/v5.37.17/config.ini
Search for ‘html5′ string in the file and replace the HTML5 version with the new Kaltura HTML5 Player V2 version. Save the file.
Re-deploy the KMC:
php /opt/kaltura/app/deployment/uiconf/deploy_v2.php –ini=/opt/kaltura/web/flash/kmc/vX.XX.XX/config.ini

Clear the Kaltura cache and restart Apache:
php /opt/kaltura/app/alpha/scripts/clear_cache.php
sudo /etc/init.d/httpd restart.

Hi Jess,
Thank you for your kind help. Can I use the first method above? I have studio_version = v1.5

If your Kaltura Platform version is older and doesn’t include the HTML5 studio, then the method above

; kmc applications versions
kmc_content_version = v3.2.12.2
kmc_account_version = v3.1.3
kmc_appstudio_version = v2.2.3
kmc_rna_version = v1.1.8.4
kmc_dashboard_version = v1.0.14.2
kmc_login_version=v1.2.5
kcw_flex_wrapper_version = v1.2
editors_flex_wrapper_version = v1.01
kdp_wrapper_version = v11.0
kdp3_wrapper_stats_url =
kdp3_wrapper_version=v37.0
html5_version= v2.11
clipapp_version=v1.0.7
studio_version = v1.5
kmc_version=v5.37.21

/opt/kaltura/web/flash/kmc/v5.37.21/config.ini
widgets.kdp1.html5_version = v2.11

Hi @astrava,

You can follow the below procedure but I cannot guarantee that it will work correctly nor can I officially provide support for it. Like I said, the best route to take would be the upgrade the entire server. If you still want to try it, you’re welcome to do so.

  • Download https://github.com/kaltura/mwEmbed/archive/v2.69.5.tar.gz and extract to /opt/kaltura/web/html5/html5lib/v2.69.5
  • ln -sf /opt/kaltura/app/configurations/html5.php /opt/kaltura/web/html5/html5lib/v2.69.5/LocalSettings.php
  • Edit the html5_version in /opt/kaltura/app/configurations/local.ini and set it to v2.69.5
  • KMC_PATH=`ls -ld $BASE_DIR/web/flash/kmc/v* 2>/dev/null|awk -F " " ‘{print $NF}’ |tail -1`
    edit $KMC_PATH/config.ini and set all .*.html5_version directives to v2.69.5
  • run php $BASE_DIR/app/deployment/uiconf/deploy_v2.php --ini=$KMC_PATH/config.ini
  • reload Apache

Create a new player from KMC->Studio and ensure everything loads correctly and that an entry can be played.
If so, you can then upgrade the existing players by issuing this update statement:

echo 'update ui_conf set html5_url = "/html5/html5lib/v2.69.5/mwEmbedLoader.php" where html5_url like "%html5lib/v2.%/mwEmbedLoader.php"'|mysql -h$DB1_HOST -u $SUPER_USER -p$SUPER_USER_PASSWD -P$DB1_PORT $DB1_NAME

Great. Thank you, Jess. I really appreciate your time and effort. Dmitri

KMC_PATH=ls -ld $BASE_DIR/web/flash/kmc/v* 2>/dev/null|awk -F " " ‘{print $NF}’ |tail -1
awk: ‘{print
awk: ^ invalid char ‘▒’ in expression

/opt/kaltura/web/flash/kmc/v5.37.21/
KMC_PATH=$BASE_DIR/web/flash/kmc/v5.37.21

•Edit the html5_version in /opt/kaltura/app/configurations/local.ini and set it to v2.69.5
added
html5_version =

Hi Jess,

I can’t load HTML5 Player after running update. I wonder if you could advice. Thank you.

kaltura-html5lib ver in KMC config.ini] [FAILED, RC: 1] - [.082682431]
[kaltura-kdp3 ver in KMC config.ini] [PASSED, RC: 0] - [.040278962]

ERR: exception ‘Exception’ with message ‘Error updating drop folder [13] - The usage of feature [dropFolder] is forbidden’ in /client/kaltura/app/infra/log/KalturaLog.php:82

sudo php /client/kaltura/app/deployment/uiconf/deploy_v2.php --ini=/client/kaltura/web/flash/kmc/v5.37.21/config.ini
Deployed successfully

KMC_PATH=ls -ld $BASE_DIR/web/flash/kmc/v* 2>/dev/null|awk -F " " ' {print $NF}' |tail -1

LocalSettings.php -> /opt/kaltura/app/configurations/html5.php

vim /client/kaltura/apps/studio/v1.5/studio.ini

/client/kaltura/web/html5/html5lib/v2.69.5/

I’m advancing with different errors

“Error in creating cache directory”

kWidget: Kaltura HTML5 Version: 2.69.5

Error: Using non-production version of kaltura player library. Please see http://knowledge.kaltura.com/production-player-urls

# mkdir -p /client/kaltura/web/html5/html5lib/v2.69.5/cache
# chown -R apache.apache /client/kaltura/web/html5/html5lib/v2.69.5/cache

Hi Jess,

Thank you for your time and effort.
I can now load player but not in preview

Mixed Content: The page at ‘’ was loaded over HTTPS, but requested an insecure plugin data ‘’. This content should also be served over HTTPS.

We have Kaltura server taking to Proxy server on port 80 and Proxy server to public on port 443

apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and default servers:
default:443 mydomain.ca (/etc/httpd/conf.d/ssl.conf:74)
*:80 mydomain.ca (/etc/httpd/conf.d/zzzkaltura.conf:1)
Syntax OK

proxy server

ServerName mydomain.ca

;# NameVirtualHost mydomain.ca:80

#This part is to lock down the apache server from a know vulnerability

<IfModule mod_rewrite.c>

TraceEnable off

RewriteEngine On

RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)

RewriteRule .* - [F]

#redirect all port 80 traffic to 443

RewriteCond %{SERVER_PORT} !^443$

RewriteRule ^/?(.*) https://mydomain.ca/$1 [L,R]

</IfModule>

</VirtualHost>

resolving mixed content warnings

changed to $wgHTTPProtocol = ‘https’;​ and changed back to original

PHP Parse error: syntax error, unexpected ‘^’ in /client/kaltura/web/html5/html5lib/v2.69.5/includes/DefaultSettings.php on line 30, referer: https://mydomain.ca/index.php/kmc/kmc4

/client/kaltura/web/html5/html5lib/v2.69.5/includes/DefaultSettings.php


// The version of the library:^M

$wgMwEmbedVersion = ‘2.69.5’;

^M

// Default HTTP protocol from GET or SERVER parameters^M

;#if( isset($_GET[‘protocol’]) ) {^M

;# $wgHTTPProtocol = ($_GET[‘protocol’] == ‘https’) ? ‘https’ : ‘http’;^M

;#} else {^M

;# $wgHTTPProtocol = (isset($_SERVER[‘HTTPS’]) && $_SERVER[‘HTTPS’] == ‘on’) ? ‘https’ : ‘http’;^M

$wgHTTPProtocol = ‘https’ ;

Error getting sources from server. Please try again.
couldn’t connect to host

Mixed Content: The page at ‘https://mydomain.ca/index.php/kmc/kmc4#content|manage’ was loaded over HTTPS, but requested an insecure plugin resource ‘http://cdnapi.kaltura.com/index.php/kwidget/wid/_112/uiconf_id/23448807/entry_id/0_aiz3bfvx/cache_st/1533916377’. This request has been blocked; the content must be served over HTTPS.

"Error in creating cache directory"https://mydomain.ca/html5/html5lib/v2.69.
5/mwEmbedLoader.php/p/112/uiconf_id/23448807

Changed from to
$wgKalturaServiceUrl = 'http://cdnapi.kaltura.com’;^M
// if https use cdnsecakmi^M
if( $wgHTTPProtocol == ‘https’ ){^M
$wgKalturaServiceUrl = ‘https://cdnapisec.kaltura.com’;^M
}^M

to
$wgKalturaServiceUrl = 'https://cdnapisec.kaltura.com’;^M
// if https use cdnsecakmi^M
if( $wgHTTPProtocol == ‘https’ ){^M
$wgKalturaServiceUrl = ‘https://cdnapisec.kaltura.com’;^M
}^M

I still have some permissions issues

018-08-10 13:23:45 [0.000740] [172.17.28.91] [474136120] [API] [KalturaStatement->execute] DEBUG: Sql took - 0.00060105323791504 seconds
2018-08-10 13:23:45 [0.001010] [172.17.28.91] [474136120] [API] [KalturaFrontController->getExceptionObject] ERR: exception ‘KalturaAPIException’ with message ‘The usage of feature [dropFolder] is forbidden’ in /client/kaltura/app/plugins/drop_folder/services/DropFolderService.php:16
Stack trace:
#0 /client/kaltura/app/api_v3/lib/KalturaActionReflector.php(251): DropFolderService->initService(‘dropfolder_drop…’, ‘dropFolder’, ‘update’)

[0.000448] [198.103.180.1] [687679924] [PS2] [KExternalErrors::dieError] ERR: exception ‘Exception’ with message ‘exiting on error 22 - requested ui_conf not found’ in /client/kaltura/app/infra/log/KalturaLog.php:82
Stack trace:

We have solved the issue by replacing the content of html5.php from new Kaltura release.

<?php /** * This file store all of mwEmbed local configuration ( in a default svn check out this file is empty ) * See includes/DefaultSettings.php for a configuration options */ // Old kConf path $kConfPath = '/opt/kaltura/app/alpha/config/kConf.php'; if( ! file_exists( $kConfPath ) ) { // New kConf path $kConfPath = '/opt/kaltura/app/infra/kConf.php'; if( ! file_exists( $kConfPath ) ) { die('Error: Unable to find kConf.php at ' . $kConfPath); } } // Load kaltura configuration file require_once( $kConfPath ); $kConf = new kConf(); // Kaltura HTML5lib Version $wgKalturaVersion = basename(getcwd()); // Gets the version by the folder name // The default Kaltura service url: $wgKalturaServiceUrl = wgGetUrl('cdn_api_host'); // Default Kaltura CDN url: $wgKalturaCDNUrl = wgGetUrl('cdn_host'); // Default Stats URL $wgKalturaStatsServiceUrl = wgGetUrl('stats_host'); // Default Live Stats URL $wgKalturaLiveStatsServiceUrl = wgGetUrl('live_stats_host'); // Default Kaltura Analytics URL $wgKalturaAnalyticsServiceUrl = wgGetUrl('analytics_host');

Thank you Jess for all your kind help and time.