Updating from 2.1 to 2.2

From SpinetiX Support Wiki

Jump to: navigation, search

When updating from firmware version 2.1 to 2.2 on the HMP, some backward compatibility issues may arise. This page lists the possible issues and how to overcome them.


Text positioning

Text area layout has been modified in version 2.2 to be compliant with the SVG specification, and to improve the compatibility with other SVG-compatible software (such as Opera). The position of the baseline of the first line is now equal to the line-increment. This causes text to appear lower in a frame than in version 2.1.

Side effect:

  • fit_text template from version 2.1 of HMD might not display the text anymore due to a rounding error. The solution is either to use the new fit_text template, or to edit the template to increase the vertical margin by 20%.

SVG duration

SVG files with no animations have a duration of 0 in firmware 2.2, whereas they had duration of 'indefinite' in 2.1. If the file is included in another SVG file with a dur='media', and without a fill='freeze', the file will be displayed only for a single frame. For these files, use a duration of 'indefinite'.

The same issue may occure in SVG document containing script. If the duration of the file is not explicitly set to indefinite, the document may ends (and thus be considered as static) before the scripts are actually run. To solve this case, make sure the attribute dur='indefinite' is set on the svg element of the document.

Image duration

Images, when included in an animation tag, have a duration of 0. Thus events triggered on the endEvent of the animation will be executed as soon as the image is opened. This may causes problems when output effects were applied to a media in the news template.

Explicitly setting the duration to 'indefinite' or to a fixed duration will solve the problem.

Automatic duration of SVG file

In 2.1 firmware the end of an SVG file corresponds to the last change in the document. In 2.2 the end of the SVG file corresponds to the end of the last active interval.

As a consequence, if a <set> element is used without a duration or and end even, the SVG file containing this <set> will have an indefinite duration in 2.2 firmware.

Explicitly setting <set dur='10s' [...] /> or <set end='slide.end' [...]/> for instance will solve the issue.

spx:begin vs begin

In version 2.1, the spx:begin attribute was used for synchronization and creating clock templates. Since version 2.2, the begin attribute from the SMIL specification together with the wallclock value should be used.

This ensures proper behavior when daylight saving time changes occur.


id attribute

In version 2.1, accessing the id of an element using elem.id was returning an empty string "" if there was no id attribute on this element. However this is not compliant with the SVG specification.

In version 2.2 null is returned in order to improve the compliance.

Side effect:

  • all news templates created with previous version of HMD will generate a JavaScript error when opened in HMD and will not render anything on the HMP.

To solve this issue, in all the news templates, the following line:

if ( id.length>0 )

should be replaced by:

if ( id!==null && id.length>0 )


The attribute nodeName was supported in version 2.1. However it is not part of the SVG uDom and support for this function has been removed.

Use localName instead.

getAttribute( "xlink:href" )

In version 2.1, using getAttribute( "xlink:href" ) was returning the content of the href attribute. This is no longer supported in version 2.2.

Use instead

getAttributeNS( "http://www.w3.org/1999/xlink", "href" );


In version 2.1, the following syntax was supported:

getAttributeNS( spxNS, "spx:myattribute" ); 

However, using a namespace prefix in the attribute name is not valid and is no longer supported in 2.2.

Use instead:

getAttributeNS( spxNS, "myattribute" ); 


Calling alert() without argument was returning 'undefined' in version 2.1.

In version 2.2.0 to 2.2.3 of the Firmware, this may crash the player or create unexpected results.

Make sure alert is called with an argument:

alert("some string");
This page was last modified on 29 August 2014, at 18:11.