[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[原创代码] [HTA 源码] 豆瓣FM网页播放器

[HTA 源码] 豆瓣FM网页播放器,写给喜欢这个网页播放器的人 by yu2n

在线预览:http://douban.fm/radio
源码下载:[attach]8017[/attach]

2015.01.08 更新:网络不通时,自动尝试重新连接(如将播放器加入系统启动项运行时,ADSL可能还未准备好。)。
  1. <html>
  2. <html>
  3. <hta:Application ID="douban_fm" ApplicationName="douban_fm" Title="豆瓣FM"
  4. border="thin" borderstyle="normal" caption="yes" icon="http://douban.fm/favicon.ico"
  5. maximizebutton="no" minimizebutton="yes" closebutton="yes" showintaskbar="yes" singleinstance="yes"
  6. sysmenu="yes" version="1.0" windowstate="minmize"
  7. />
  8.   <head>
  9.   <title>豆瓣FM</title>
  10.   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  11.   <script language=JavaScript type="text/javascript">
  12.   // 在窗口显示前更改窗口大小
  13.   while (true) {try {var w=420,h=0; window.resizeTo(w, h); window.moveTo((window.screen.width - w) / 2, (window.screen.height - h) / 2); break; } catch (e) {continue;} }
  14.   // 屏蔽错误
  15.   window.onerror=function(){return true;}
  16.   // 在标题栏显示载入中
  17.   var strTitle = document.title;
  18.   document.title = strTitle + " - 载入中 ... ";
  19.   // 判断网络连接
  20.   if (!ping("douban.fm")) {
  21.     document.title = strTitle + " - 网络故障,请检查网络连接 ...";
  22.     setInterval("document.execCommand('Refresh');douban_fm.icon='http://douban.fm/favicon.ico';", 3000);
  23.   };
  24.   // 载入框架后执行
  25.   function douban_loading()
  26.   {
  27.     win_resize(420,186);
  28.     document.title = strTitle;
  29.   }
  30.   // 修改窗口内页面的大小(非窗口)
  31.   function win_resize(w,h)
  32.   {
  33.     var winWidth, winHeight;
  34.     var w2=w, h2=h;
  35.     for (var i = 0; i < window.screen.width; i++)
  36.     {
  37.       //获取窗口宽度
  38.       if (window.innerWidth)
  39.         winWidth = window.innerWidth;
  40.       else if ((document.body) && (document.body.clientWidth))
  41.         winWidth = document.body.clientWidth;
  42.       //获取窗口高度
  43.       if (window.innerHeight)
  44.         winHeight = window.innerHeight;
  45.       else if ((document.body) && (document.body.clientHeight))
  46.         winHeight = document.body.clientHeight;
  47.       //通过深入Document内部对body进行检测,获取窗口大小
  48.       if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth)
  49.       {
  50.         winHeight = document.documentElement.clientHeight;
  51.         winWidth = document.documentElement.clientWidth;
  52.       }
  53.       
  54.       // 小于指定大小时,调大窗口
  55.       if (winWidth <= w)(w2 = w + i);
  56.       if (winHeight <= h)(h2 = h + i);
  57.       if ((winWidth >= w) && (winHeight >= h)){break;}
  58.       window.resizeTo(w2, h2);
  59.       window.moveTo((window.screen.width - w2) / 2, (window.screen.height - h2) / 2);
  60.     }
  61.   }
  62.   // Ping
  63.   function ping(host){
  64.     var oWmic = GetObject("winmgmts:{impersonationLevel=impersonate}"
  65.         ).ExecQuery("select * from Win32_PingStatus where address = '" + host + "'")
  66.     var oEnum = new Enumerator(oWmic); for (; !oEnum.atEnd(); oEnum.moveNext()) {
  67.       if (oEnum.item().ResponseTime != null && oEnum.item().ResponseTime >= 0) return(true);
  68.     }; return(false);
  69.   }
  70.   </script>
  71.   <style type="text/css">
  72.   html, body { margin: 0px; padding: 0px; }
  73.   .douban_fm_iframe {
  74.     height: 100%; width: 100%;
  75.     margin: 0px; padding: 0px;
  76.     overflow: visible;
  77.   }
  78.   </style>
  79.   </head>
  80.   <body>
  81.     <iframe class="douban_fm_iframe" src="http://douban.fm/radio" scrolling="NO" onload="douban_loading();">
  82.   </body>
  83. </html>
复制代码
2

评分人数

    • 523066680: 好用,收藏了PB + 18 技术 + 1
    • Spring: 用着感觉不错!技术 + 1
『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

感谢分享!

TOP

多谢分享!
nevermore

TOP

小东西还是做成hta好啊,去页面始终麻烦

TOP

多米音乐在线播放-online music  (by yu2n)
  1. <html>
  2. <hta:Application ID="duomi.com" ApplicationName="duomi.com"
  3. border="thin" borderstyle="normal" caption="yes" icon="http://duomi.com/favicon.ico"
  4. maximizebutton="no" minimizebutton="yes" closebutton="yes" showintaskbar="yes" singleinstance="yes"
  5. sysmenu="yes" version="1.0" windowstate="minmize" />
  6.   <head>
  7.     <title>多米音乐在线播放-online music</title>
  8.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  9.         <script language=JavaScript type="text/javascript">
  10.         // 在窗口显示前更改窗口大小
  11.                 while (true) {try {var w=760,h=0; window.resizeTo(w, h); window.moveTo((window.screen.width - w) / 2, (window.screen.height - h) / 2); break; } catch (e) {continue;} }
  12.         
  13.         // 屏蔽错误
  14.         window.onerror=function(){return true;}
  15.         
  16.         // 在标题栏显示载入中
  17.         var strTitle = document.title;
  18.         document.title = strTitle + " - Loading ... ";
  19.         
  20.         // 载入框架后执行
  21.         function douban_loading()
  22.         {
  23.             win_resize(760,520);
  24.             document.title = strTitle;
  25.         }
  26.         
  27.         // 修改窗口内页面的大小(非窗口)
  28.         function win_resize(w,h)
  29.         {
  30.             var winWidth, winHeight;
  31.             var w2=w, h2=h;
  32.             for (var i = 0; i < window.screen.width; i++)
  33.             {
  34.                 //获取窗口宽度
  35.                 if (window.innerWidth)
  36.                     winWidth = window.innerWidth;
  37.                 else if ((document.body) && (document.body.clientWidth))
  38.                     winWidth = document.body.clientWidth;
  39.                 //获取窗口高度
  40.                 if (window.innerHeight)
  41.                     winHeight = window.innerHeight;
  42.                 else if ((document.body) && (document.body.clientHeight))
  43.                     winHeight = document.body.clientHeight;
  44.                 //通过深入Document内部对body进行检测,获取窗口大小
  45.                 if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth)
  46.                 {
  47.                     winHeight = document.documentElement.clientHeight;
  48.                     winWidth = document.documentElement.clientWidth;
  49.                 }
  50.                
  51.                 // 小于指定大小时,调大窗口
  52.                 if (winWidth <= w)(w2 = w + i);
  53.                 if (winHeight <= h)(h2 = h + i);
  54.                 if ((winWidth >= w) && (winHeight >= h)){break;}
  55.                 window.resizeTo(w2, h2);
  56.                 window.moveTo((window.screen.width - w2) / 2, (window.screen.height - h2) / 2);
  57.             }
  58.                 }
  59.         </script>
  60.     <style type="text/css">
  61.     html, body { margin: 0px; padding: 0px; }
  62.     .douban_fm_iframe {
  63.         height: 100%; width: 100%;
  64.         margin: 0px; padding: 0px;
  65.         overflow: visible;
  66.     }
  67.     </style>
  68.   </head>
  69.     <body>
  70.         <iframe class="douban_fm_iframe" src="http://app.duomiyy.com/webradio/hao123/" scrolling="NO" onload="douban_loading();">
  71.     </body>
  72. </html>
复制代码
多米音乐在线播放-online music  (来自官方插件)
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta http-equiv="X-UA-Compatible" content="chrome=1">
  7. <meta name="keywords" content="" />
  8. <meta name="description" content="" />
  9. <title>在线音乐播放-online music</title>
  10. </head>
  11. <body style="text-align:center;background: #dbdbdb;color: #666666;overflow: hidden;">
  12. <iframe src="http://app.duomiyy.com/webradio/hao123/"  id="iframepage" name="iframepage" width=760 height=520 frameBorder=0 scrolling=no style=""></iframe>
  13. </body>
  14. </html>
复制代码
『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

TOP

在MSN(123.msn.com)上看到另一个版本
http://douban.fm/partner/msnav
『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

TOP

感谢楼主!我很喜欢用豆瓣的啦~

TOP

返回列表