Skip to content

Instantly share code, notes, and snippets.

@laechan
Created November 19, 2020 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laechan/851354c204fa4de03db0ff40ab039879 to your computer and use it in GitHub Desktop.
Save laechan/851354c204fa4de03db0ff40ab039879 to your computer and use it in GitHub Desktop.
some live channel
<html>
<html>
<Meta Http-Equiv="Content-Type" Content="text/html; Charset=utf-8">
<body bgcolor="#93DD93">
<script type="text/javascript">
var lives={
"中視新聞":"https://www.youtube.com/watch?v=lSZZ3YRsW1w",
"華視新聞":"https://www.youtube.com/watch?v=-pvROC_MdYM",
"民視新聞":"https://www.youtube.com/watch?v=XxJKnDLYZz4",
"公共電視":"https://www.youtube.com/watch?v=ED4QXd5xAco",
"客家電視":"https://www.youtube.com/watch?v=LWwepk1p5kE",
"新唐人":"https://www.youtube.com/watch?v=wSKE3A40SIk",
"NBC News":"https://www.youtube.com/watch?v=6F8p0YA5yWY",
"JapaNews24":"https://www.youtube.com/watch?v=coYw-eVU0Ks",
"台灣地震監視":"https://www.youtube.com/watch?v=GmnBAjLQFic",
};
keys_lives=Object.keys(lives);
MEDIA_WIDTH=380;
MEDIA_HEIGHT=260;
str="<table border=1>";
j=keys_lives.length;
for(i=0;i<j;i++)
{
if(i%3==0)
str+="<tr>";
str+="<th valign=top width="+MEDIA_WIDTH+" height="+MEDIA_HEIGHT+">"+keys_lives[i]+"<BR>";
url=lives[keys_lives[i]];
urls=url.split("watch?v=");
url=urls[0]+"embed/"+urls[1]+"?rel=0&autoplay=1&mute=1&vq=medium";
str+="<iframe width="+(MEDIA_WIDTH-20)+" height="+
(MEDIA_HEIGHT-20)+" src='"+url+"' frameborder=0 allow='"+
"accelerometer; clipboard-write; encrypted-media; "+
"gyroscope; picture-in-picture' allowfullscreen></iframe><BR>";
str+"</td>";
if(i%3==2)
str+="</tr>";
}
if(i%3!=2)
str+="</tr>";
str+="</table>";
document.write(str);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment