JSFiddle - React, Tailwind, and code Playground

by Stev Peifer

HTML

<div id="someID">
</div>

JavaScript

(
    function($){
        $.fn.twitchTV=function(option){
            var _this=$.extend({},this),
            memory={
                read:new Object(),
                write:new Object()
            },
            option=$.extend(true,{},
                {
                    'stream':[
                        {
                            'channel':'runescape',
                            'option':{
                                'autoPlay':false,
                                'startVolume':75
                            }
                        }
                    ],
                    'ratio':1,
                    'showChat':false
                },option),
            variable={
                chat:{
                    height:378*option.ratio,
                    width:300
                },
                option:new Array(),
                stream:{
                    height:378*option.ratio,
                    width:620*option.ratio
                }
            };
            memory.read=this.clone().empty();
            memory.write.tab=new Array();
            memory.write.container=new Array();
            memory.write.stream=new Array();
            memory.write.chat=new Array();
            for(var streamIndex in option.stream){
                option.stream[streamIndex].option=$.extend(true,{},
                    {
                        'autoPlay':false,
                        'showChat':false,
                        'startVolume':75
                    },option.stream[streamIndex].option);
                
                variable.option[streamIndex]='hostname=www.twitch.tv'
                    +'&auto_play='+option.stream[streamIndex].option.autoPlay
                    +'&channel='+option.stream[streamIndex].channel
                    +'&start_volume='+option.stream[streamIndex].option.startVolume;
                variable.option[streamIndex]=variable.option[streamIndex].replace(/amp;/g,'');

               ...