var randomUUID = function() { var s = [] var itoh = '0123456789ABCDEF'.split(''); ; for (var i = 0; i <16; i++) s[i] = itoh[Math.floor(Math.random()*0x10)]; return s.join(''); } function UGSLPlayer(elm, src, config) { // Create unique element name var playerId = "ugsl" + randomUUID(); // Write Silverlight object tag var silverlightObj = ''+ '' + ''+ ''+ ''+ ''+ '' + 'Microsoft Silverlight niet gevonden'; // Build Silverlight object into HTML element elm.innerHTML = silverlightObj; // Create access methods for config and playlist properties document.getElementById(playerId).getConfigProperty = function(property) { if (this.content != null) return this.content.ugslAccess.getConfigProperty(property); }; document.getElementById(playerId).setConfigProperty = function(property, value) { if (this.content != null) this.content.ugslAccess.setConfigProperty(property, value); }; document.getElementById(playerId).getPlaylistProperty = function(property, index) { if (this.content != null) return this.content.ugslAccess.getPlaylistProperty(property, index); }; document.getElementById(playerId).setPlaylistProperty = function(property, index) { if (this.content != null) this.content.ugslAccess.setPlaylistProperty(property, index); }; // Return silverlight object return document.getElementById(playerId); }