I have been using javascript conditional compilation to determine the version of the IE Trident engine:
var ieVersion = undefined;
/*@cc_on
ieVersion = Math.floor(@_jscript_version);
@*/
Despite working fine for IE8, 9, and 10, in IE11, the conditionally-commented block does not execute unless I use the F12 dev tools to emulate IE10. This discrepancy is confusing given that the MSDN page on conditional compilation specifies that it applies to Internet Explorer 11. (UPDATE 2015-02-03: this page has been updated to state that its content does not apply to IE11 in standards mode.) There isn't much information online indicating that IE11 should not support conditional comments.
If anyone has any insights or can reproduce this behavior in IE11, please share!
Edit: the issue revolves around IE's <audio>
support. My web app requires playback of approximately 50 short (~1 sec) audio files in a random order individually after user interaction. However, there are various problems:
- IE9 has an undocumented limit of 41
audio
elements which causes subsequent audio files to fail silently. Re-assigning the source also fails every second time. The root cause behind these bugs remains unknown. - IE10 and IE11 experience stutter when playing short sounds - they play a fraction of a second then pause before continuing. This renders the audio unintelligible despite having preload="auto" and reported non-zero buffer.
Detecting these issues via feature detection is impractical, hence the browser-detect approach. Though user-agent sniffing may be risky for production code, the @cc_on technique seemed more reliable.
To workaround the issue in IE9, I serialize the app state to sessionStorage after the 25th sound, then reload the page and deserialize.
In IE10/11, my workaround involves playing the last 90% of the audio at 0 volume to force proper buffering.