Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The flashembed method has an <code>onFail</code> argument which takes a callback as a value: </p> <pre><code>$("#flash").flashembed({ src: flashSWF, version:[10,0], id:"flashObj", width: 500, height: 300, wmode: "opaque", cachebusting: "false", allowscriptaccess: "always", api: "false", scale: "noscale", menu: "false", onFail: flasherror("#flash") }) </code></pre> <p>It inadvertently fires on both success AND failure. Search for the <code>,</code> character to distinguish between the two states. On error, it shows up as the delimiter in the version string, such as <code>11,0</code> rather than <code>11.0</code>:</p> <pre><code>function flashError(domnode, newtext){ function failState() { if ($(domnode).html().search(/,/) !== -1) //player failed to load { newtext = $(domnode).html(); // store default error string $(domnode).empty(); $(domnode).append(newtext.replace(/,/g,".")); // replace comma with period if ($(domnode).hasClass("flashmsg") === false) { $(domnode).addClass("flashmsg"); // add class to custom error element } } else { //success logic } } // observer constructor var cursor = typeof window.hasOwnProperty === "function" ? window.hasOwnProperty("WebKitMutationObserver") ? new WebKitMutationObserver(startValidation) : window.hasOwnProperty("MutationObserver") ? new MutationObserver(startValidation) : false : false ; //Use observer event if it exists if (cursor) { //Bind observer event to text child of the dom node cursor.observe($(domnode).get(0), { childList: true } ); return; } //Use mutation event as a fallback else if (!!document.addEventListener) { $(domnode).get(0).addEventListener("DOMNodeInserted", failState, false); } //Use readystatechange event for legacy IE else { $(domnode).get(0).addBehavior("foo.htc"); $(domnode).get(0).attachEvent("onreadystatechange", failState); } </code></pre> <p><strong>References</strong></p> <ul> <li><p><a href="http://flash.flowplayer.org/documentation/configuration/player.html" rel="nofollow">FlashEmbed Configuration</a></p></li> <li><p><a href="https://msdn.microsoft.com/en-us/library/dn265032" rel="nofollow">Migrating mutation and property change events to mutation observers</a></p></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload