{"id":210,"date":"2017-12-03T02:42:42","date_gmt":"2017-12-03T02:42:42","guid":{"rendered":"https:\/\/html5box.com\/blog\/?p=210"},"modified":"2017-12-03T03:05:43","modified_gmt":"2017-12-03T03:05:43","slug":"play-twitch-video-with-html5-gallery","status":"publish","type":"post","link":"https:\/\/html5box.com\/blog\/jquery-video-gallery\/play-twitch-video-with-html5-gallery\/","title":{"rendered":"Play Twitch video with HTML5 Gallery"},"content":{"rendered":"<p><strong>Product<\/strong>:<\/p>\n<p><a href=\"http:\/\/html5box.com\/html5gallery\/index.php\" rel=\"noopener\" target=\"_blank\">HTML5 Gallery<\/a><\/p>\n<p><strong>Question<\/strong>:<\/p>\n<p>I am trying to use the HTML5Gallery and I see you have Vimeo and YouTube. I wonder how can I play Twitch video in HTML5 Gallery?<\/p>\n<p><strong>Answer<\/strong>:<\/p>\n<p>1. In the Twitch video player page, click the Share button, copy the code from the \"Embed Video\" text box.<\/p>\n<p>2. From the \"Embed Share\" text, copy the src attribute value of the iframe. It will have a format like https:\/\/player.twitch.tv\/?autoplay=false&video=vXXXXXXXX<\/p>\n<p>3. When adding the Twitch video the gallery, add a data attribute <code>data-mediatype=12<\/code> to the &lt;a&gt; tag.<\/p>\n<p>A demo code snippet is as follows:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;div style=&quot;display:none;&quot; class=&quot;html5gallery&quot; data-skin=&quot;gallery&quot; data-width=&quot;480&quot; data-height=&quot;272&quot;&gt;\r\n    \r\n  &lt;!-- Add Twitch video to Gallery --&gt;\r\n  &lt;a href=&quot;https:\/\/player.twitch.tv\/?autoplay=false&amp;video=v206184868&quot; data-mediatype=12&gt;&lt;img src=&quot;https:\/\/html5box.com\/html5gallery\/images\/Desert_256.jpg&quot; alt=&quot;Twitch Video&quot;&gt;&lt;\/a&gt;\r\n\r\n  &lt;!-- Add Youtube video to Gallery --&gt;\r\n  &lt;a href=&quot;http:\/\/www.youtube.com\/embed\/YE7VzlLtp-4&quot;&gt;&lt;img src=&quot;http:\/\/img.youtube.com\/vi\/YE7VzlLtp-4\/2.jpg&quot; alt=&quot;Youtube Video&quot;&gt;&lt;\/a&gt;\r\n\r\n&lt;\/div&gt;\r\n<\/pre>\n<div style=\"display:none;\" class=\"html5gallery\" data-skin=\"gallery\" data-width=\"480\" data-height=\"272\">\n<p>  <!-- Add Twitch video to Gallery --><br \/>\n  <a href=\"https:\/\/player.twitch.tv\/?autoplay=false&video=v206184868\" data-mediatype=12><img decoding=\"async\" src=\"https:\/\/html5box.com\/html5gallery\/images\/Desert_256.jpg\" alt=\"Twitch Video\"><\/a><\/p>\n<p>  <!-- Add Youtube video to Gallery --><br \/>\n  <a href=\"https:\/\/www.youtube.com\/embed\/YE7VzlLtp-4\"><img decoding=\"async\" src=\"https:\/\/img.youtube.com\/vi\/YE7VzlLtp-4\/2.jpg\" alt=\"Youtube Video\"><\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Product: HTML5 Gallery Question: I am trying to use the HTML5Gallery and I see you have Vimeo and YouTube. I wonder how can I play Twitch video in HTML5 Gallery? Answer: 1. In the Twitch video player page, click the Share button, copy the code from the \"Embed Video\" text box. 2. From the \"Embed &hellip; <a href=\"https:\/\/html5box.com\/blog\/jquery-video-gallery\/play-twitch-video-with-html5-gallery\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Play Twitch video with HTML5 Gallery<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,6],"tags":[],"class_list":["post-210","post","type-post","status-publish","format-standard","hentry","category-jquery-gallery","category-jquery-video-gallery"],"_links":{"self":[{"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/posts\/210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/comments?post=210"}],"version-history":[{"count":20,"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/posts\/210\/revisions"}],"predecessor-version":[{"id":230,"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/posts\/210\/revisions\/230"}],"wp:attachment":[{"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/media?parent=210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/categories?post=210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/tags?post=210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}