How to embed videos & channels dynamically

In order to embed videos or channels dynamically into any HTML page. You can use the following script tag and add it to the head tag of your HTML document.

<script>!function (e, t, i) { if (void 0 === e._dyntube_v1_init) { e._dyntube_v1_init = !0; var a = t.createElement("script"); a.type = "text/javascript", a.async = !0, a.src = "https://embed.dyntube.com/v1.0/dyntube.js", t.getElementsByTagName("head")[0].appendChild(a) } }(window, document);</script>

Once the script has been added, you can add a div tag to your page where the video/channel needs to be displayed. The div tag should have the attribute data-dyntube-key. The value should be channelKey field of the video or the value should be the key of your video channel. You can find the channelKey of a video by listing your videos using API.

<div data-dyntube-key="1YUNqRTds12DxjljCVnHQ"></div>

Last updated