Dưới đây xin share code tạo trang xem tivi online ngay tại blog,tuy còn đơn giản vì ít kênh nhưng cũng đáp ứng phần nào nhu cầu xem ca nhạc tin tức và bóng đá ngay tại blog.
DEMO nè:
Model 1
Code:
<style>
button {
border : 1px solid #6a8da4;
cursor : pointer;
width:83px;
height:22px;
text-transform:uppercase;
font-size:10px;
}
button:hover {
color: #ffffff;
border : 1px solid #000000;
cursor : pointer;
width:83px;
height:22px;
text-transform:uppercase;
font-size:10px;
}
</style>
<iframe bottommargin="0" frameborder="0" id="MPlayer" leftmargin="0" marginheight="0" marginwidth="0" name="MPlayer" nosize="" rightmargin="0" scrolling="no" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpYv7-HJ7vVlu981rpAONbcoKI5NPaOr4s7qHbuFGY_tUkDAdg53BJdaj9Cc9c1JDXWtze46sdVazVmRbNxId3rcBZpYL7j16tWHWvO2EBQj0GBWkwedAdhr062rvDvum-cx_mLottmGo/s1600/Logo.TV.Online+(1).jpg" style="height: 450px; width: 600px;" topmargin="0"></iframe>
<div id="channel_center" style="height: 130px; max-height: 130px; overflow: auto; text-align: center; width: 600px;">
<button onclick="document.getElementById('MPlayer').src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpYv7-HJ7vVlu981rpAONbcoKI5NPaOr4s7qHbuFGY_tUkDAdg53BJdaj9Cc9c1JDXWtze46sdVazVmRbNxId3rcBZpYL7j16tWHWvO2EBQj0GBWkwedAdhr062rvDvum-cx_mLottmGo/s1600/Logo.TV.Online+(1).jpg'"><span style="color: red; font-size: xx-small;"><b>TẮT TIVI</b></span></button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-viet-nam-vtv-truc-tuyen-online&xem=vtv1'">VTV1</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-viet-nam-vtv-truc-tuyen-online&xem=vtv2'">VTV2</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-viet-nam-vtv-truc-tuyen-online&xem=vtv3'">VTV3</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-viet-nam-vtv-truc-tuyen-online&xem=vtv4'">VTV4</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=hanoi1'">HàNội 1</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=hanoi2'">HàNội 2</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=thvl1'">VĩnhLong 1</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=thvl2'">VĩnhLong 2</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=dong-thap'">ÐồngTháp</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=dong-nai-1'">ÐồngNai 1</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=dong-nai-2'">ĐồngNai 2</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=tien-giang'">TiềnGiang</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=hau-giang'">HậuGiang</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=vung-tau'">VũngTàu</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=quang-ngai'">QuảngNgãi</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=quang-nam'">QuảngNam</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=binh-thuan'">BìnhThuận</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=long-an'">LongAn</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=vinh-phuc'">VĩnhPhúc</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-viet-nam-vtv-truc-tuyen-online&xem=infotv'">InfoTV</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=trt1-hue'">TRT1Huế</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=saigontv'">SàiGònTV</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=htv7'">HTV7</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh&xem=htv9'">HTV9</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-viet-nam-vtv-truc-tuyen-online&xem=vtv1(vtc)'">VTV1(VTC)</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-viet-nam-vtv-truc-tuyen-online&xem=vtv2(vtc)'">VTV2(VTC)</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-viet-nam-vtv-truc-tuyen-online&xem=vtv3(vtc)'">VTV3(VTC)</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-viet-nam-vtv-truc-tuyen-online&xem=vtv4(vtc)'">VTV4(VTC)</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-viet-nam-vtv-truc-tuyen-online&xem=vctv12(styletv)'">VCTV12</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-kts-vtc-truc-tuyen-online&xem=vtc1'">VTC1</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-kts-vtc-truc-tuyen-online&xem=vtc2'">VTC2</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-kts-vtc-truc-tuyen-online&xem=vtc3'">VTC3</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-kts-vtc-truc-tuyen-online&xem=vtc4'">VTC4</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-kts-vtc-truc-tuyen-online&xem=vtc6'">VTC6</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-kts-vtc-truc-tuyen-online&xem=vtc8'">VTC8</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-kts-vtc-truc-tuyen-online&xem=vtc9'">VTC9</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-kts-vtc-truc-tuyen-online&xem=vtc10'">VTC10</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-kts-vtc-truc-tuyen-online&xem=vtc14'">VTC14</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-kts-vtc-truc-tuyen-online&xem=vtc16'">VTC16</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv1'">SCTV1</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv2'">SCTV2</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv3'">SCTV3</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv4'">SCTV4</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv5'">SCTV5</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv6'">SCTV6</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv7'">SCTV7</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv8'">SCTV8</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv9'">SCTV9</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv10'">SCTV10</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv11'">SCTV11</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv12'">SCTV12</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv13'">SCTV13</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv14'">SCTV14</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv15'">SCTV15</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv16'">SCTV16</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-cap-sctv-truc-tuyen-online&xem=sctv17'">SCTV17</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=nghe-radio-viet-nam-truc-tuyen-online&xem=vov-gt-hn'">VOV-HN</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=nghe-radio-viet-nam-truc-tuyen-online&xem=vov-gt-tphcm'">VOV-TPHCM</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=nghe-radio-viet-nam-truc-tuyen-online&xem=vov-tv'">VOV-TV</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=nghe-radio-viet-nam-truc-tuyen-online&xem=vov1'">VOV1</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-kts-vtc-truc-tuyen-online&xem=itv'">ITV</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-kts-vtc-truc-tuyen-online&xem=itv_music'">ITV_Music</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-kts-vtc-truc-tuyen-online&xem=vtc1(vtc)'">VTC1(VTC)</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-kts-vtc-truc-tuyen-online&xem=vtc2(vtc)'">VTC2(VTC)</button><button onclick="document.getElementById('MPlayer').src='http://tv.xunghe.vn/newwindow.php?type=4&tab=truyen-hinh-kts-vtc-truc-tuyen-online&xem=vtc9(vtc)'">VTC9(VTC)</button>
</div>