ZM 1.24.2 javascript errors in opera & can't change scal

Forum for questions and support relating to the 1.24.x releases only.
Locked
BlankMan
Posts: 147
Joined: Tue Jan 19, 2010 2:53 am
Location: Milwaukee, WI USA

ZM 1.24.2 javascript errors in opera & can't change scal

Post by BlankMan »

java java-1_6_0-sun-1.6.0.u18-0.1.1.x86_64

java is installed in opera and validated and working correctly.

Getting this error every time I watch a camera, or an error for each camera in montage.

Below is the javascript error I'm getting with stack trace enabled and the source of the page it's having the problem with.

No associated errors in apache's or zoneminder's logs.

Also, when I try and scale the video to 1/2 scale or any scale nothing happens. I can change to 2-wide 3-wide etc. but I can't scale

Code: Select all

                                                         
JavaScript - http://mywebsite/ZM/index.php?view=montage&group=0
Unknown thread                                                 
Error:                                                         
name: TypeError                                                
message: Statement on line 43: Cannot convert undefined or null to Object
stacktrace:   Line 43 of linked script http://mywebsite/ZM/skins/classic/views/js/montage.js
                stream.className=stateClass;                                                
  ...  Line 607 of linked script http://mywebsite/ZM/tools/mootools/mootools-1.2.1-core-nc.js
                                return self.apply(options.bind || null, args);               
  Line 612 of linked script http://mywebsite/ZM/tools/mootools/mootools-1.2.1-core-nc.js     
                        return returns();                                                    
  ...  Line 607 of linked script http://mywebsite/ZM/tools/mootools/mootools-1.2.1-core-nc.js
                                return self.apply(options.bind || null, args);               
  Line 612 of linked script http://mywebsite/ZM/tools/mootools/mootools-1.2.1-core-nc.js     
                        return returns();                                                    
  Line 1204 of linked script http://mywebsite/ZM/tools/mootools/mootools-1.2.1-core-nc.js    
                        fn.create({'bind': this, 'delay': delay, 'arguments': args})();      
  ...  Line 1203 of linked script http://mywebsite/ZM/tools/mootools/mootools-1.2.1-core-nc.js
                this.$events[type].each(function(fn){                                         
  Line 3686 of linked script http://mywebsite/ZM/tools/mootools/mootools-1.2.1-core-nc.js     
                this.fireEvent('complete', arguments).fireEvent('success', arguments).callChain();
  Line 3943 of linked script http://mywebsite/ZM/tools/mootools/mootools-1.2.1-core-nc.js         
                this.onSuccess(this.response.json, text);                                         
  Line 3664 of linked script http://mywebsite/ZM/tools/mootools/mootools-1.2.1-core-nc.js         
                        this.success(this.response.text, this.response.xml);                      
  ...  Line 607 of linked script http://mywebsite/ZM/tools/mootools/mootools-1.2.1-core-nc.js     
                                return self.apply(options.bind || null, args);                    
  Line 612 of linked script http://mywebsite/ZM/tools/mootools/mootools-1.2.1-core-nc.js          
                        return returns();                                                         
  ...                                                                                             

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">                                 
<html xmlns="http://www.w3.org/1999/xhtml">                                                                                                               
<head>                                                                                                                                                    
  <title>ZM - Montage</title>                                                                                                                             
  <link rel="icon" type="image/ico" href="graphics/favicon.ico"/>                                                                                         
  <link rel="shortcut icon" href="graphics/favicon.ico"/>                                                                                                 
  <link rel="stylesheet" href="css/reset.css" type="text/css"/>                                                                                           
  <link rel="stylesheet" href="skins/classic/css/skin.css" type="text/css" media="screen"/>                                                               
  <link rel="stylesheet" href="skins/classic/views/css/montage.css" type="text/css" media="screen"/>                                                      
  <script type="text/javascript" src="tools/mootools/mootools-1.2.1-core-nc.js"></script>                                                                 
  <script type="text/javascript" src="tools/mootools/mootools-1.2-more-nc.js"></script>                                                                   
  <script type="text/javascript" src="js/mootools.ext.js"></script>                                                                                       
  <script type="text/javascript">                                                                                                                         
  var AJAX_TIMEOUT = 3000;                                                                                                                                

  var currentView = 'montage';
  var thisUrl = "http://mywebsite/ZM/index.php";
  var skinPath = "skins/classic";               

  var canEditSystem = true;
  var canViewSystem = true;

  var refreshParent = false;

  var focusWindow = true;
  </script>              
  <script type="text/javascript">
//                               
// Import constants              
//                               
var STATE_IDLE = 0;              
var STATE_PREALARM = 1;          
var STATE_ALARM = 2;             
var STATE_ALERT = 3;             
var STATE_TAPE = 4;              

var stateStrings = new Array();
stateStrings[STATE_IDLE] = "Idle";
stateStrings[STATE_PREALARM] = "Idle";
stateStrings[STATE_ALARM] = "Alarm";  
stateStrings[STATE_ALERT] = "Alert";  
stateStrings[STATE_TAPE] = "Record";  

var CMD_QUERY = 99;

var SCALE_BASE = 100;

var COMPACT_MONTAGE = 1;
var SOUND_ON_ALARM = 0; 
var POPUP_ON_ALARM = 1; 

var statusRefreshTimeout = 3000;

var canStreamNative = false;

var monitorData = new Array();
monitorData[monitorData.length] = { 'id': 1, 'connKey': 81227, 'width': 720,'height':480 };
monitorData[monitorData.length] = { 'id': 4, 'connKey': 864422, 'width': 720,'height':480 };
monitorData[monitorData.length] = { 'id': 2, 'connKey': 515996, 'width': 704,'height':480 };
monitorData[monitorData.length] = { 'id': 9, 'connKey': 935663, 'width': 640,'height':480 };
  </script>                                                                                 
  <script type="text/javascript" src="skins/classic/js/skin.js"></script>                   
  <script type="text/javascript" src="skins/classic/views/js/montage.js"></script>          
</head>                                                                                     
<body>                                                                                      
  <div id="page">                                                                           
    <div id="header">                                                                       
      <div id="headerButtons">                                                              
        <a href="#" onclick="closeWindow()">Close</a>                                       
      </div>                                                                                
      <h2>Montage</h2>                                                                      
      <div id="headerControl">                                                              
        <span id="scaleControl">Scale: <select name="scale" id="scale" onchange="changeScale( this );">
<option value="400">4x</option>                                                                        
<option value="300">3x</option>                                                                        
<option value="200">2x</option>                                                                        
<option value="150">1.5x</option>                                                                      
<option value="100" selected="selected">Actual</option>                                                
<option value="75">3/4x</option>                                                                       
<option value="50">1/2x</option>                                                                       
<option value="33">1/3x</option>                                                                       
<option value="25">1/4x</option>                                                                       
</select>                                                                                              
</span>                                                                                                
        <label for="layout">Layout:</label><select name="layout" id="layout" onchange="selectLayout( this )">
<option value="montage_freeform.css">Default</option>                                                        
<option value="montage_2wide.css" selected="selected">2-wide grid</option>                                   
<option value="montage_3wide.css">3-wide grid</option>                                                       
<option value="montage_4wide.css">4-wide grid</option>                                                       
<option value="montage_3wide50enlarge.css">3-wide grid, scaled, enlarge on alarm</option>                    
</select>                                                                                                    
      </div>                                                                                                 
    </div>                                                                                                   
    <div id="content">                                                                                       
      <div id="monitors">                                                                                    
        <div id="monitorFrame0" class="monitorFrame">                                                        
          <div id="monitor0" class="monitor idle">                                                           
            <div id="imageFeed0" class="imageFeed" onclick="createPopup( '?view=watch&mid=1', 'zmWatch1', 'watch', 720, 480 );">
<embed type="video/x-msvideo"                                                                                                   
src="http://mywebsite/cgi-bin/nph-zms?mode=mpeg&monitor=1&scale=100&bitrate=2000000&maxfps=30&format=avi&auth=a347da0349657d8d5ae762312fedaa99&connkey=81227"                                                                                                                                                       
name=""                                                                                                                                                   
width="720"                                                                                                                                               
height="480"                                                                                                                                              
autostart="1"                                                                                                                                             
autoplay="1"                                                                                                                                              
showcontrols="0"                                                                                                                                          
controller="0">                                                                                                                                           
</embed>                                                                                                                                                  
            </div>                                                                                                                                        
          </div>                                                                                                                                          
        </div>                                                                                                                                            
        <div id="monitorFrame1" class="monitorFrame">                                                                                                     
          <div id="monitor1" class="monitor idle">                                                                                                        
            <div id="imageFeed1" class="imageFeed" onclick="createPopup( '?view=watch&mid=4', 'zmWatch4', 'watch', 720, 480 );">                          
<embed type="video/x-msvideo"                                                                                                                             
src="http://mywebsite/cgi-bin/nph-zms?mode=mpeg&monitor=4&scale=100&bitrate=2000000&maxfps=30&format=avi&auth=a347da0349657d8d5ae762312fedaa99&connkey=864422"                                                                                                                                                      
name=""                                                                                                                                                   
width="720"                                                                                                                                               
height="480"                                                                                                                                              
autostart="1"                                                                                                                                             
autoplay="1"                                                                                                                                              
showcontrols="0"                                                                                                                                          
controller="0">                                                                                                                                           
</embed>                                                                                                                                                  
            </div>                                                                                                                                        
          </div>                                                                                                                                          
        </div>                                                                                                                                            
        <div id="monitorFrame2" class="monitorFrame">                                                                                                     
          <div id="monitor2" class="monitor idle">                                                                                                        
            <div id="imageFeed2" class="imageFeed" onclick="createPopup( '?view=watch&mid=2', 'zmWatch2', 'watch', 704, 480 );">                          
<embed type="video/x-msvideo"                                                                                                                             
src="http://mywebsite/cgi-bin/nph-zms?mode=mpeg&monitor=2&scale=100&bitrate=2000000&maxfps=30&format=avi&auth=a347da0349657d8d5ae762312fedaa99&connkey=515996"                                                                                                                                                      
name=""                                                                                                                                                   
width="704"                                                                                                                                               
height="480"                                                                                                                                              
autostart="1"                                                                                                                                             
autoplay="1"                                                                                                                                              
showcontrols="0"                                                                                                                                          
controller="0">                                                                                                                                           
</embed>                                                                                                                                                  
            </div>                                                                                                                                        
          </div>                                                                                                                                          
        </div>                                                                                                                                            
        <div id="monitorFrame3" class="monitorFrame">
          <div id="monitor3" class="monitor idle">
            <div id="imageFeed3" class="imageFeed" onclick="createPopup( '?view=watch&mid=9', 'zmWatch9', 'watch', 640, 480 );">
<embed type="video/x-msvideo"
src="http://mywebsite/cgi-bin/nph-zms?mode=mpeg&monitor=9&scale=100&bitrate=2000000&maxfps=30&format=avi&auth=a347da0349657d8d5ae762312fedaa99&connkey=935663"
name=""
width="640"
height="480"
autostart="1"
autoplay="1"
showcontrols="0"
controller="0">
</embed>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>
</html>
BlankMan
Posts: 147
Joined: Tue Jan 19, 2010 2:53 am
Location: Milwaukee, WI USA

Post by BlankMan »

Get this javascript error when I try to change the scale. Source page referenced is the same. Well, this finally explains why scaling doesn't work, hope someone knows a fix.

Code: Select all

JavaScript - http://mywebsite/ZM/index.php?view=watch&mid=1
Event thread: change
Error:
name: TypeError
message: Statement on line 40: Cannot convert undefined or null to Object
stacktrace:   Line 40 of linked script http://mywebsite/ZM/skins/classic/views/js/watch.js: In function changeScale
        streamImg.style.width = newWidth + "px";
  Line 1 of function script
    changeScale( this );
  ...
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Post by mastertheknife »

Hi,

I have both Opera 10 and Opera 9.64 and scaling (even to 1/2) works fine in both.

Make sure to use JPEG stream mode and not MPEG.
Scale works fine in native MJPEG stream and cambozola, but not in MPEG.
BlankMan
Posts: 147
Joined: Tue Jan 19, 2010 2:53 am
Location: Milwaukee, WI USA

Post by BlankMan »

Is that it? Scaling only works works in MJPEG and does not work in MPEG mode?

That would explain it. Yes I finally got MPEG working and that is where it doesn't work. Is that a known limitation? I'll play around with that in opera and firefox.
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Post by mastertheknife »

I'm not sure if its a limitation, i was simply reporting what worked for me.
Also, In event page, there is a line that needs to be commented out for scaling to work properly in certain browsers and not kill the stream. The same line is already commented out in realtime page.

There are many problems with MPEG mode, and scaling seems to be one of them.
Locked