Custom widget working on my local Thingworx, not on the production server
- May 10, 2022
- 2 replies
- 3695 views
Hello,
I created a custom widget in order to integrate the OvenMedia WebRTC player (https://airensoft.gitbook.io/ovenplayer/). I included the Third part javascript and the player is starting on my local computer but not in the production environment. What could be the problem & how can I analyze this?
Development environment: Thingworx 9.1.0-b10877
Production environment: Thinworx 9.2.5-b308
The code to import the ovenmedia js and start the player is the following one:
this.renderHtml = function () {
$("body").append('<script type="text/javascript" src="../Common/extensions/OvenPlayer/ui/OvenPlayer/include/ovenplayer.js"></script>');
var html = '<div class="player-wrapper"><div id="player_id"></div><div id="player_label">TEST</div></div>';
return html;
};
this.afterRender = function () {
document.getElementById("player_label").innerHTML = "DEBUG1.3";
OvenPlayer.debug(true);
document.getElementById("player_label").innerHTML = OvenPlayer.getPlayerList().length;
var player = OvenPlayer.create('player_id', {
sources: [
{
label: 'label_for_webrtc',
// Set the type to 'webrtc'
type: 'webrtc',
// Set the file to WebRTC Signaling URL with OvenMediaEngine
file: 'ws://10.10.10.10:3334/mystream/arm' //updatePropertyInfo.StreamURL
}
]
});
document.getElementById("player_label").innerHTML = player;
player.play();
document.getElementById("player_label").innerHTML =OvenPlayer.getPlayerList();
};

