jtulach commented on code in PR #56:
URL: https://github.com/apache/netbeans-html4j/pull/56#discussion_r3246393600
##########
sound/src/main/java/org/netbeans/html/sound/impl/BrowserAudioEnv.java:
##########
@@ -33,9 +33,13 @@ private BrowserAudioEnv() {
}
@Override
- @JavaScriptBody(args = { "src" }, body = ""
- + "if (typeof Audio !== 'object') return null;"
- + "return new Audio(src);")
Review Comment:
- in 2013 I had to distinguish among old JDK7 JavaFX WebView without `Audio`
- and newer WebViews (JDK8+) that had `Audio` object
- or real browsers that had `Audio` too
- at that time the `typeof Audio` was `object`
- these days it is `function`
- inspite of calling `Audio("some.mp3")` yields and error suggesting to
use `new Audio(...)` instead!
- I know the https://github.com/jtulach/minesweeper was playing [its
sounds](https://github.com/jtulach/minesweeper/blob/master/client/src/main/webapp/pages/move.mp3)
in the past
- there must have been an **incompatible change** in the browsers since then
- that changed the `typeof Audio`
- interesting way to break someone's code
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists