{"product_id":"xhorse-new-super-chip-xt57b","title":"Xhorse NEW Super Chip - Improved ID46 - Now Supports MQB48 \/ MQB49 \/ 4A \u0026 Old Coverage - XT57B","description":"\u003cp\u003e\u003ciframe src=\"https:\/\/www.youtube.com\/embed\/nHrsujTcThI?\u0026amp;autoplay=1\u0026amp;start=10\u0026amp;loop=1\u0026amp;mute=1\u0026amp;controls=0\u0026amp;rel=0\u0026amp;showinfo=0\u0026amp;color=white\u0026amp;iv_load_policy=3\u0026amp;playlist=nHrsujTcThI\" height=\"auto\" width=\"100%\" type=\"text\/html\" id=\"ytplayer\" class=\"embed-responsive-item\"\u003e\u003c\/iframe\u003e \u003cscript type=\"text\/javascript\"\u003e\n  const THE_IFRAME_SELECTOR = 'iframe[id^=\"ytplayer\"]'; \/\/ matches all iframes with an id that starts with h5p-embed-responsive-item\nconst THE_VIDEO_SELECTOR = 'embed-responsive-item'; \/\/ since all videos appear to have the same class you don't need to change this\n\nwaitForMultipleElements(document, THE_IFRAME_SELECTOR, () =\u003e {\n  let ALL_IFRAMES = document.querySelectorAll(THE_IFRAME_SELECTOR);\n  ALL_IFRAMES.forEach(FOUND_IFRAME =\u003e {\n    let FOUND_IFRAME_SELECTOR = `#${FOUND_IFRAME.id}`;\n    console.log(\"FOUND_IFRAME_SELECTOR:\", FOUND_IFRAME_SELECTOR)\n    waitForElement(document, FOUND_IFRAME_SELECTOR, () =\u003e {\n      waitForVideoElement(FOUND_IFRAME_SELECTOR, THE_VIDEO_SELECTOR, () =\u003e {\n        initPageVisibleApi(FOUND_IFRAME_SELECTOR, THE_VIDEO_SELECTOR);\n      });\n    });\n  });\n});\n\nfunction waitForMultipleElements(parentEl, selector, callback) {\n  let theInterval = setInterval(() =\u003e {\n    console.log('still waiting for all elements: ' + selector);\n    let elements = parentEl.querySelectorAll(selector);\n    if (elements.length) {\n      console.log(\"elements: \" + selector + \" exist!\");\n      clearInterval(theInterval);\n      callback();\n    }\n  }, 1000);\n}\n\nfunction waitForVideoElement(iframeSelector, videoElementSelector, callback) {\n  let theIframeElement = document.querySelector(iframeSelector);\n  let iframeEl = theIframeElement.contentWindow.document;\n  waitForElement(iframeEl, videoElementSelector, () =\u003e {\n    callback()\n  });\n}\n\nfunction waitForElement(parentEl, selectorOfElementToWaitFor, callback) {\n  let theInterval = setInterval(() =\u003e {\n    console.log(\"still waiting for \" + selectorOfElementToWaitFor);\n    let element = parentEl.querySelector(selectorOfElementToWaitFor);\n    if (element) {\n      console.log(selectorOfElementToWaitFor + \" exists!\");\n      clearInterval(theInterval);\n      callback();\n    }\n  }, 100);\n}\n\nfunction initPageVisibleApi(iframeSelector, videoSelector) {\n  \/\/ This is the same code that builds out the Page Visible API\n  \/\/ event listeners. \n  \/\/ The only difference is I wrapped it in a function and added \n  \/\/ parameters to make it flexible.\n  const iframe = document.querySelector(iframeSelector);\n  const innerDoc = (iframe.contentDocument) ? iframe.contentDocument : iframe.contentWindow.document;\n  const videoElement = innerDoc.querySelector(videoSelector);\n  \/\/ Set the name of the hidden property and the change event for visibility\n  var hidden, visibilityChange;\n  if (typeof document.hidden !== \"undefined\") { \/\/ Opera 12.10 and Firefox 18 and later support \n    hidden = \"hidden\";\n    visibilityChange = \"visibilitychange\";\n  } else if (typeof document.msHidden !== \"undefined\") {\n    hidden = \"msHidden\";\n    visibilityChange = \"msvisibilitychange\";\n  } else if (typeof document.webkitHidden !== \"undefined\") {\n    hidden = \"webkitHidden\";\n    visibilityChange = \"webkitvisibilitychange\";\n  }\n\n  \/\/ To tell if video has been played yet or not\n  let VIDEO_HAS_BEEN_PLAYED = false;\n  \/\/ If the page is hidden, pause the video;\n  \/\/ if the page is shown, play the video\n  function handleVisibilityChange() {\n    if (VIDEO_HAS_BEEN_PLAYED) {\n      if (document[hidden]) {\n        videoElement.pause();\n      } else {\n        videoElement.play();\n      }\n    }\n  }\n  \/\/ Warn if the browser doesn't support addEventListener or the Page Visibility API\n  if (typeof document.addEventListener === \"undefined\" || hidden === undefined) {\n    alert(\"This demo requires a browser, such as Google Chrome or Firefox, that supports the Page Visibility API.\");\n  } else {\n    \/\/ Handle page visibility change   \n    document.addEventListener(visibilityChange, handleVisibilityChange, false);\n\n    \/\/ When the video pauses, set the title.\n    \/\/ This shows the paused\n    const defaultTitle = document.title;\n    videoElement.addEventListener(\"pause\", function () {\n      document.title = 'Paused - ' + defaultTitle;\n    }, false);\n    \/\/ When the video plays, set the title.\n    videoElement.addEventListener(\"play\", function () {\n      VIDEO_HAS_BEEN_PLAYED = true;\n      document.title = 'Playing - ' + defaultTitle;\n    }, false);\n  }\n}\n\u003c\/script\u003e\u003c\/p\u003e\n\u003cp\u003e\u003cimg src=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0667\/1391\/1516\/files\/XT57B.png?v=1776279466\" alt=\"\"\u003e\u003c\/p\u003e","brand":"xhorse","offers":[{"title":"Default Title","offer_id":50025435922652,"sku":"TC10045","price":3.84,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0667\/1391\/1516\/files\/Gemini_Generated_Image_xic4ayxic4ayxic4.jpg?v=1776279249","url":"https:\/\/keyshop-online.com\/products\/xhorse-new-super-chip-xt57b","provider":"Keyshop-Online","version":"1.0","type":"link"}