1/* 2 * @author Rob W (http://stackoverflow.com/a/7513356/938089 3 * @description Executes function on a framed YouTube video (see previous link) 4 * For a full list of possible functions, see: 5 * http://code.google.com/apis/youtube/js_api_reference.html 6 * @param String frame_id The id of (the div containing) the frame 7 * @param String func Desired function to call, eg. "playVideo" 8 * @param Array args (optional) List of arguments to pass to function func*/ 9function callPlayer(frame_id, func, args) { 10 if (window.jQuery && frame_id instanceof jQuery) frame_id = frame_id.get(0).id; 11 var iframe = document.getElementById(frame_id); 12 if (iframe && iframe.tagName.toUpperCase() != 'IFRAME') { 13 14 iframe = iframe.getElementsByTagName('iframe')[0]; 15 } 16 if (iframe) { 17 // Frame exists, 18 iframe.contentWindow.postMessage(JSON.stringify({ 19 "event": "command", 20 "func": func, 21 "args": args || [], 22 "id": frame_id 23 }), "*"); 24 } 25}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.