var remaining_audio_init_timeout; var Player; function DrawTB(UseAudio, ImagePath, CamNbr, MediaRecording, HideMicSettings, ptz, streamProfileNr, streamProfileName) // NOTE: HideMicSettings = "yes" for 207, otherwise it should be "no" (or undefined) { var useMpeg = ImagePath.indexOf("h264") != -1 || ImagePath.indexOf("mpeg4") != -1; var useMjpeg = ImagePath.indexOf("mjpg") != -1; if (Player && typeof(Player.Play) != "undefined") { var config = "+play,+snapshot,+fullscreen"; if ((useMjpeg || useMpeg) && MediaRecording != 0) { Player.EnableRecording = MediaRecording; } if (ptz == "yes") { config+= ",+ptz"; } else { config+= ",-ptz"; } if ((useMjpeg || useMpeg) && MediaRecording != 0) { config+= ",+rec"; } else { config+= ",-rec"; } if (UseAudio == "yes") { if (HideMicSettings == "yes") { config+= ",+mute,+volume,-audiocontrol"; } else { config+= ",+audiocontrol"; } } else { config+= ",-audiocontrol"; } Player.ToolbarConfiguration = config; if (UseAudio == "yes" && (!(useMpeg && MediaRecording != 0) || (HideMicSettings != "yes" || useMpeg))) { remaining_audio_init_timeout = 5000; doAudioCheck(ImagePath, CamNbr, MediaRecording, ptz, streamProfileNr, streamProfileName); } if (UseAudio == "yes") { try { Player.Play(); } catch(e) {} } } } function doAudioCheck(ImagePath, CamNbr, MediaRecording, ptz, streamProfileNr, streamProfileName) { var audioComp = document.getElementById("AudioComponent"); var aacDec = document.getElementById("AAC Decoder"); if (!audioComp && !aacDec) { if (remaining_audio_init_timeout > 0) { setTimeout('doAudioCheck()', 250); remaining_audio_init_timeout -= 250; } else if (MediaRecording != 0) { Player.EnableRecording = MediaRecording; } } else { initAudio(ImagePath, CamNbr, MediaRecording, ptz, streamProfileNr, streamProfileName); } } function activateContextMenu() { if (Player && typeof(Player.Play) != "undefined") { Player.EnableContextMenu = "1"; return; } else { setTimeout('activateContextMenu()', 250); } } function initAudio(ImagePath, CamNbr, MediaRecording, ptz, streamProfileNr, streamProfileName) { var confHost = getCurrentHostAndProt(); Player.AudioConfigURL = confHost + "/axis-cgi/view/param.cgi?camera=" + CamNbr + "&usergroup=anonymous&action=list&group=Audio,AudioSource.A0" + (!isNaN(streamProfileNr) ? ",StreamProfile.S" + streamProfileNr : ""); Player.AudioTransmitURL = "/axis-cgi/audio/transmit.cgi"; if (ImagePath.indexOf("mjpg") != -1) { var recieveURL = "/axis-cgi/audio/receive.cgi?audio=1&camera=" + CamNbr; if (streamProfileName != "") recieveURL += "&streamprofile=" + streamProfileName; Player.AudioReceiveURL = confHost + recieveURL; } if (MediaRecording != 0) Player.EnableRecording = MediaRecording; } function InstallFilter(prodName, ID, CLSID_filter, ver_filter, cab, installText1, text, installText2, installText3, installText4) { var createdElement = document.createElement('' + ID + ' ' + installText1 + ' ' + text + ' ' + installText2 + ' ' + installText3 + '' +ID + ' ' + installText4 + ''); filterinstallocation.appendChild(createdElement); } function InstallDecoder(prodName, ID, CLSID_AMC, cab, ver_AMC, authorized, notAuthorizedText, authorizedText, installDecoderText1, installDecoderText2) { var installedVersion = "0,0,0,0"; try { installedVersion = document.Player.GetVersionPart(CLSID_AMC,0); installedVersion += ',' + document.Player.GetVersionPart(CLSID_AMC,1); installedVersion += ',' + document.Player.GetVersionPart(CLSID_AMC,2); installedVersion += ',' + document.Player.GetVersionPart(CLSID_AMC,3); } catch(e) {} var newerVersion = false; instVerArray = installedVersion.split(","); verAMCArray = ver_AMC.split(","); for (i=instVerArray.length-1; i>=0; i--) { // Compare first integer last since that's the most significant one. if (parseInt(verAMCArray[i]) > parseInt(instVerArray[i])) { newerVersion = true; } else if ((parseInt(verAMCArray[i]) == parseInt(instVerArray[i])) && newerVersion) { newerVersion = true; } else { newerVersion = false; } } if (newerVersion) { document.write('' + notAuthorizedText + ''); } else { document.write('') } else if (ID == "H.264 Decoder") { document.write('/incl/license_h264.shtml\')">') } else { document.write('/incl/license.shtml\')">') } document.write(authorizedText + '') } if (installedVersion == "0,0,0,0") { document.write('' + installDecoderText1); if (authorized == "yes") { document.write('' + installDecoderText2); } } else { document.write('' + installDecoderText2); } document.write(''); } } function drawMpeg4Dec(height, width, ImagePath, CLSID_AMC, cab, ver_AMC) { document.write(''); } function drawAacDec(height, width, ImagePath, CLSID_AAC_dec, cab, ver_AAC_dec) { document.write(''); } function DrawAMC(prodName, ID, height, width, ImagePath, CLSID_AMC, cab, ver_AMC, ShowAMCToolbar, ptzgui, useWithCam, CamNbr, UseRel, ShowRelCross, ShowSVG, UseMotion, UseAudio, rtspPort, external, installText1, text, installText2, installText3, installText4, mediaRecording, extra, enableAreaZoom) // NOTE: extra = "yes" -> 207, extra = "9999" means centermode (zoom=9999) is activated in 212PTZ, extra = "recording" -> recording playback, otherwise extra should be "no" or undefined. { var host = getHost(ImagePath); var confHost = getCurrentHostAndProt(); var mpeg4 = ImagePath.indexOf("videocodec=mpeg4") != -1; var h264 = ImagePath.indexOf("videocodec=h264") != -1; var mjpg = ImagePath.indexOf("videocodec=mjpg") != -1; var mpeg2 = ImagePath.indexOf("videocodec=mpeg2") != -1; var multicast = ImagePath.indexOf("sdp") != -1; document.write(''); if ((mpeg4 || h264) && external == "no") { document.write(''); } else if (ImagePath.indexOf("://") > 0 || external == "yes") { document.write(''); } else { document.write(''); } var MediaType; if (mpeg4) { MediaType = "mpeg4" } else if (h264) { MediaType = "h264" } else if (mpeg2) { if (multicast) MediaType = "mpeg2-multicast" else MediaType = "mpeg2-unicast" } else { MediaType = "mjpeg" } document.write(''); document.write(''); // 207 document.write(''); document.write(''); document.write(''); document.write(''); if ((ptzgui == "yes") && (useWithCam == "yes")) { extra += "" document.write(''); } document.write('' + ID + ' ' + installText1 + ' ' + text + ' ' + installText2 + ' ' + installText3 + '' + ID + ' ' + installText4); document.write(''); Player = document.getElementById("Player"); if (Player.ShowToolbar) { // This line is essential when installing AMC or else volume and mute buttons will show until reload if (ShowAMCToolbar == "yes") { if (extra == "yes") { // = 207 Player.ToolbarConfiguration = "+play,+snapshot,+fullscreen,+mute,+volume"; } } } if (UseMotion == "yes") { Player.UIMode = "MDConfig"; Player.MotionConfigURL = confHost + "/axis-cgi/operator/param.cgi?ImageSource=" + [CamNbr - 1] Player.MotionDataURL = confHost + "/axis-cgi/motion/motiondata.cgi"; } if (ShowSVG == "yes") { Player.SvgDataURL = confHost + "/axis-cgi/iv/stream.cgi?channel=9"; } activateContextMenu() if ((enableAreaZoom == "yes") && (useWithCam == "yes")) { Player.EnableJoystick = "True"; Player.EnableAreaZoom = "True"; } if (extra == "recording") { Player.EnableReconnect = "false"; // Don't start playback again when the recording has reached the end. Player.Popups = 0; // Don't display "Video lost" popup baloon when the recording has reached the end. } } function getHost(ImagePath) { var host; var indexOfAddr; indexOfAddr = ImagePath.indexOf("://"); if (indexOfAddr > 0) { host = ImagePath.substring(0,indexOfAddr + 3); } else { if (ImagePath.indexOf("videocodec=mpeg4") >= 0 || ImagePath.indexOf("videocodec=h264") >= 0) { host = "rtsp://" + getIPv6HostName(location.hostname); } else { host = getCurrentHostAndProt(); } } return host; } function getCurrentHostAndProt() { return location.protocol + "//" + getIPv6HostName(location.hostname) + (location.port > 0 ?':' + location.port : ""); } function getIPv6HostName(hostname) { if (hostname.split(":").length > 1) hostname = "[" + hostname + "]" return hostname; }
' + notAuthorizedText + ''); } else { document.write('
') } else if (ID == "H.264 Decoder") { document.write('/incl/license_h264.shtml\')">') } else { document.write('/incl/license.shtml\')">') } document.write(authorizedText + '') } if (installedVersion == "0,0,0,0") { document.write('' + installDecoderText1); if (authorized == "yes") { document.write('' + installDecoderText2); } } else { document.write('' + installDecoderText2); } document.write('