Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1215 lines
38 KiB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>TV Player</TITLE>
  4. </HEAD>
  5. <BODY SCROLL="no" BGCOLOR="#0" OnLoad="Init();">
  6. <SCRIPT LANGUAGE="JScript">
  7. /******** ATVEF variables *****************/
  8. var g_bAutoEnhancement = false; // Automatically show enhancement when available?
  9. var g_iEnhState = 0; // 0 = No enhancement available
  10. // 1 = enh available, waiting for trigger
  11. // 2 = enh & trigger available, waiting for user
  12. // 3 = enh & trigger available and being displayed
  13. var g_pCurEnh; // Current enhancement. Valid if g_iEnhState >= 1
  14. var g_pCurTrig; // Last trigger. Valid if g_iEnhState >= 2
  15. /******* Other variables ******************/
  16. // Misc Constants
  17. var g_iStartChannel = 5;
  18. var g_strIPAddress = "0.0.0.0";
  19. var g_bUseWinProp = false;
  20. var g_iBigITimeOut = 10000; // milliseconds for which Big I is shown
  21. // Dimensions
  22. var g_cDefaultAppHeight = 600; // Total height of app window in windowed mode
  23. var g_cDefaultPanelHeight = 40; // Height of control panel (below screen)
  24. var g_cTitleBarHeight = 20; // Height of title bar (above screen)
  25. var g_cAspectRatio = 16.0/9.0; // Width/Height of screen area
  26. // State variables
  27. var g_InitializationState = 1; // 0 Creating Objects 1 Init 2 Run, 3 done
  28. var g_bIsFullScreen = true; // Cached value of FullScCtl.FullScreen
  29. var g_bSndBeforePause = true;
  30. var g_bIsVideoRunning = true;
  31. // Button controls
  32. var g_nNumButs = 15;
  33. var g_strButID; // Object IDs
  34. var g_nButPos = new Array(
  35. /* Fields: x, y, width, height, display?, x-base, y-base */
  36. new Array( -35, 2, 15, 15, 'none', 2, 0), //maximize 0
  37. new Array( -35, 2, 15, 15, '', 2, 0), //restore 1
  38. new Array( -50, 2, 15, 15, '', 2, 0), //minimize 2
  39. new Array( -20, 2, 15, 15, '', 2, 0), //close 3
  40. new Array(-100, -25, 24, 18, '', 1, 1), //pause 4
  41. new Array(-100, -25, 24, 18, 'none', 1, 1), //play 5
  42. new Array( 26, -25, 24, 18, '', 1, 1), //ff 6
  43. new Array( -50, -25, 24, 18, '', 1, 1), //rw 7
  44. new Array( 75, -25, 24, 18, '', 1, 1), //not mute 8
  45. new Array( 75, -25, 24, 18, 'none', 1, 1), //mute 9
  46. new Array( 105, -25, 75, 15, '', 1, 1), //volume 10
  47. new Array( -20, -25, 40, 18, '', 1, 1), //channel number 11
  48. new Array(-150, -25, 30, 24, 'none', 1, 1), //show enhancement 12
  49. new Array(-150, -25, 30, 24, 'none', 1, 1), //show enhancement disabled 13
  50. new Array(-150, -25, 30, 24, 'none', 1, 1) //hide enhancement 14
  51. );
  52. /*************************************************************************/
  53. /* Function: Init */
  54. /*************************************************************************/
  55. function Init(){
  56. if(1 != g_InitializationState){
  57. return; // already we have initialized
  58. }/* end of if statement */
  59. g_strButID = new Array(
  60. document.Maximize,
  61. document.Restore,
  62. document.Minimize,
  63. document.Close,
  64. document.Pause,
  65. document.Play,
  66. document.FastForward,
  67. document.Rewind,
  68. document.NotMute,
  69. document.Mute,
  70. document.VolSlider,
  71. document.ChannelNumberTextBox,
  72. document.ShowEnh,
  73. document.ShowEnhDisabled,
  74. document.HideEnh
  75. );
  76. if (g_bUseWinProp == true)
  77. {
  78. //WinProp.BackgroundImage = "player1.bmp";
  79. }
  80. StatusBar.style.left = document.body.clientWidth/2 - 50;
  81. StatusBar.style.top = document.body.clientHeight/2 - 15;
  82. StatusBar.EdgeStyle = "Sunken";
  83. StatusBar.FontFace = "Tahoma";
  84. StatusBar.FontSize = 11;
  85. StatusBar.Text = "Loading...";
  86. StatusBar.ColorStatic = 0xffffff;
  87. StatusBar.ColorHover = 0xffffff;
  88. StatusBar.style.display = '';
  89. ReadProfile();
  90. try {
  91. InitVidCtrl();
  92. ViewCtl.Run();
  93. StatusBar.style.display = 'none';
  94. }
  95. catch(e) {
  96. HandleError(e);
  97. return;
  98. }
  99. OnResize();
  100. max_OnClick();
  101. window.onresize = OnResize;
  102. ChannelNumberTextBox.EdgeStyle = "Sunken";
  103. ChannelNumberTextBox.FontFace = "Tahoma";
  104. ChannelNumberTextBox.FontSize = 11;
  105. ChannelNumberTextBox.Text = g_iStartChannel;
  106. ChannelNumberTextBox.ColorStatic = 0xffffff;
  107. ChannelNumberTextBox.ColorHover = 0xffffff;
  108. VolSlider.Min = 0;
  109. VolSlider.Max = 65535;
  110. VolSlider.Value = 20000;
  111. AtvefRecv.TuneTo("Channel37", g_strIPAddress);
  112. ControlsDiv.style.visibility = 'visible';
  113. ViewCtl.style.display = '';
  114. g_InitializationState = 2;
  115. }/* end of function Init */
  116. /*************************************************************/
  117. /* Name: ReadProfile */
  118. /* Description: */
  119. /*************************************************************/
  120. function ReadProfile()
  121. {
  122. try
  123. {
  124. g_strIPAddress = TVProf.IPSinkAddress;
  125. }
  126. catch(e)
  127. {
  128. alert("HKLM\Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\TVPlayer\\IPSinkAddress is not set in registry");
  129. window.close();
  130. }
  131. try
  132. {
  133. audioDest = TVProf.AudioDestination;
  134. SndCtl.ComponentType = audioDest;
  135. }
  136. catch(e)
  137. {
  138. //Continue to use default if registry value doesn't exist.
  139. }
  140. }
  141. /*************************************************************/
  142. /* Name: InitVidCtrl */
  143. /* Description: */
  144. /*************************************************************/
  145. function InitVidCtrl()
  146. {
  147. ViewCtl.AutoSize = false;
  148. //ViewCtl.MaintainAspectRatio = true;
  149. tscontainer = new ActiveXObject("Tuner.SystemTuningSpaces");
  150. bFoundTS = false;
  151. for (iTS=0; iTS < tscontainer.Count; iTS++)
  152. {
  153. try
  154. {
  155. if (bFoundTS == false)
  156. {
  157. ts = tscontainer.Item(iTS);
  158. bFoundTS = true;
  159. }
  160. }
  161. catch(e)
  162. {
  163. }
  164. }
  165. tr = ts.CreateTuneRequest();
  166. tr.Channel = g_iStartChannel;
  167. ViewCtl.View(tr);
  168. ViewCtl.Build();
  169. //ViewCtl.VideoRendererActive.ColorKey = &HFF00FF;
  170. }
  171. /*************************************************************/
  172. /* Name: OnReadyStateChange */
  173. /* Description: Handles ready state changes of the control. */
  174. /*************************************************************/
  175. function OnReadyStateChange(state)
  176. {
  177. return;
  178. }/* end of function OnReadyStateChange */
  179. /*************************************************************/
  180. /* Name: OnResize */
  181. /* Description: Handles resizing of the control. */
  182. /*************************************************************/
  183. function OnResize()
  184. {
  185. try {
  186. lAppWidth = document.body.clientWidth;
  187. lAppHeight = document.body.clientHeight;
  188. // Center line. Used as an offset for button positions.
  189. xOffset = lAppWidth/2;
  190. // One of the offsets from which button positions are measured. The other is 0.
  191. yOffset = lAppHeight;
  192. // In windowed mode buttons, title bar, and screen have their exclusive areas
  193. // In fullscreen mode buttons are superimposed on screen
  194. if (g_bIsFullScreen == false)
  195. {
  196. // TODO: Use the same logic that IE uses to resize the background BMP that we use for the panel
  197. lPanelHeight = (lAppHeight * g_cDefaultPanelHeight) / g_cDefaultAppHeight;
  198. lScreenHeight = lAppHeight - lPanelHeight - g_cTitleBarHeight;
  199. lScreenTop = g_cTitleBarHeight;
  200. }
  201. else
  202. {
  203. lScreenHeight = lAppHeight;
  204. lScreenTop = 0;
  205. }
  206. // In the horizontal dimension the screen stretches from edge to edge
  207. // in both windowed and fullscreen modes.
  208. lScreenWidth = lAppWidth;
  209. lScreenLeft = 0;
  210. // In windowed mode, round the corners of our app window using the WinProp object
  211. if (g_bUseWinProp == true)
  212. {
  213. WinProp.width = lAppWidth;
  214. WinProp.height = lAppHeight;
  215. if (g_bIsFullScreen == false)
  216. WinProp.SetRoundRectRgn(0, 0, lAppWidth+4, lAppHeight+4, 20, 20);
  217. else
  218. WinProp.SetRectRgn(0, 0, lAppWidth, lAppHeight);
  219. }
  220. for (i = 0; i < g_nNumButs; i++)
  221. {
  222. g_strButID[i].style.left = g_nButPos[i][5]*xOffset + g_nButPos[i][0];
  223. g_strButID[i].style.top = g_nButPos[i][6]*yOffset + g_nButPos[i][1];
  224. g_strButID[i].width = g_nButPos[i][2];
  225. g_strButID[i].height = g_nButPos[i][3];
  226. g_strButID[i].style.display = g_nButPos[i][4];
  227. }
  228. // Compute the largest possible size for the video control while maintaining the aspect ratio
  229. if (lScreenWidth/lScreenHeight >= g_cAspectRatio)
  230. {
  231. // height is the constraining factor and we have paddings on the left and right
  232. lVideoHeight = lScreenHeight;
  233. lVideoWidth = lScreenHeight * g_cAspectRatio;
  234. ViewCtl.style.top = lScreenTop;
  235. ViewCtl.style.left = (lScreenWidth - lVideoWidth)/2;
  236. }
  237. else
  238. {
  239. // width is the constraining factor and we have paddings on the top and bottom
  240. lVideoWidth = lScreenWidth;
  241. lVideoHeight = lScreenWidth / g_cAspectRatio;
  242. ViewCtl.style.left = lScreenLeft;
  243. //ViewCtl.style.top = (lScreenHeight - lVideoHeight)/2;
  244. ViewCtl.style.top = 2*g_cTitleBarHeight;
  245. }
  246. //alert("App = " + lAppWidth + "x" + lAppHeight);
  247. //alert("Screen = " + lScreenWidth + "x" + lScreenHeight);
  248. //alert("Video = " + lVideoWidth + "x" + lVideoHeight);
  249. ViewCtl.width = lVideoWidth;
  250. ViewCtl.height = lVideoHeight;
  251. // Position the enhancement icon 5 pixels from the top left corner of the video
  252. // document.all.TheBigI.style.top = ViewCtl.style.top + 5;
  253. // document.all.TheBigI.style.left= ViewCtl.style.left + 5;
  254. // ATVEF content can take up the entire screen area since it doesn't have an aspect ratio
  255. /*
  256. document.all.Atvef.width = lScreenWidth;
  257. document.all.Atvef.height = lScreenHeight;
  258. document.all.Atvef.style.top = lScreenTop;
  259. document.all.Atvef.style.left = lScreenLeft;
  260. */
  261. // Hack! The atvef page must be aligned with the video so that the video shows through correctly
  262. document.all.Atvef.width = lVideoWidth;
  263. document.all.Atvef.height = lScreenHeight - 2*g_cTitleBarHeight; /*lVideoHeight + (lScreenHeight - lVideoHeight)/2; */
  264. document.all.Atvef.style.top = ViewCtl.style.top;
  265. document.all.Atvef.style.left = ViewCtl.style.left;
  266. }
  267. catch(e) {
  268. HandleError(e);
  269. return;
  270. }
  271. }
  272. /*************************************************************/
  273. /* Name: play_OnClick */
  274. /* Description: OnClick callback for play/pause button */
  275. /*************************************************************/
  276. function play_OnClick()
  277. {
  278. try {
  279. ViewCtl.Run();
  280. g_bVideoIsRunning = true;
  281. SndCtl.Mute = g_bSndBeforePause;
  282. // Switch from play button to pause immediately. Also store for OnResize.
  283. Pause.style.display = '';
  284. g_nButPos[4][4] = '';
  285. Play.style.display = 'none';
  286. g_nButPos[5][4] = 'none';
  287. }
  288. catch(e) {
  289. HandleError(e);
  290. }
  291. }
  292. /*************************************************************/
  293. /* Name: pause_OnClick */
  294. /* Description: OnClick callback for play/pause button */
  295. /*************************************************************/
  296. function pause_OnClick()
  297. {
  298. try {
  299. //ViewCtl.Pause();
  300. ViewCtl.Stop();
  301. g_bVideoIsRunning = false;
  302. g_bSndBeforePause = SndCtl.Mute;
  303. SndCtl.Mute = true;
  304. Pause.style.display = 'none';
  305. g_nButPos[4][4] = 'none';
  306. Play.style.display = '';
  307. g_nButPos[5][4] = '';
  308. }
  309. catch(e) {
  310. HandleError(e);
  311. }
  312. }
  313. /*************************************************************/
  314. /* Name: fwd_OnClick */
  315. /* Description: OnClick callback for forward button */
  316. /*************************************************************/
  317. function fwd_OnClick()
  318. {
  319. try {
  320. tr.Channel = tr.Channel + 1;
  321. if (tr.Channel > tr.TuningSpace.MaxChannel)
  322. tr.Channel = tr.TuningSpace.MinChannel;
  323. ViewCtl.InputActive.Tune = tr;
  324. ChannelNumberTextBox.text = tr.Channel;
  325. }
  326. catch(e) {
  327. HandleError(e);
  328. }
  329. }
  330. /*************************************************************/
  331. /* Name: rew_OnClick */
  332. /* Description: OnClick callback for rewind button */
  333. /*************************************************************/
  334. function rew_OnClick()
  335. {
  336. try {
  337. tr.Channel = tr.Channel - 1;
  338. if (tr.Channel < tr.TuningSpace.MinChannel)
  339. tr.Channel = tr.TuningSpace.MaxChannel;
  340. ViewCtl.InputActive.Tune = tr;
  341. ChannelNumberTextBox.text = tr.Channel;
  342. }
  343. catch(e) {
  344. HandleError(e);
  345. }
  346. }
  347. /*************************************************************/
  348. /*************************************************************/
  349. function enhance_OnClick()
  350. {
  351. SetAutoEnhance();
  352. }
  353. /*************************************************************/
  354. /* Name: max_OnClick
  355. /* Description: Maximize the window
  356. /*************************************************************/
  357. function max_OnClick()
  358. {
  359. // Toggle display of Maximize and Restore buttons. To do this, just change the
  360. // values in the g_nButPos array. OnResize() will do the rest.
  361. g_nButPos[0][4] = 'none'; // Maximize
  362. g_nButPos[1][4] = ''; // Restore
  363. FullScCtl.FullScreen = true;
  364. g_bIsFullScreen = true;
  365. for (i = 0; i < g_nNumButs; i++)
  366. {
  367. g_strButID[i].BackColor = "0"; //"16711935";
  368. }
  369. /*
  370. oHTA.windowState = "maximize";
  371. WinProp.ShowWindow(3);
  372. */
  373. }
  374. /*************************************************************/
  375. /* Name: restore_OnClick
  376. /* Description: Restore the window
  377. /*************************************************************/
  378. function restore_OnClick()
  379. {
  380. // Toggle display of Maximize and Restore buttons. To do this, just change the
  381. // values in the g_nButPos array. OnResize() will do the rest.
  382. g_nButPos[0][4] = ''; // Maximize
  383. g_nButPos[1][4] = 'none'; // Restore
  384. FullScCtl.FullScreen = false;
  385. g_bIsFullScreen = false;
  386. for (i = 0; i < g_nNumButs; i++)
  387. {
  388. g_strButID[i].BackColor = "0";
  389. }
  390. /*
  391. oHTA.windowState = "normal";
  392. WinProp.ShowWindow(9);
  393. */
  394. }
  395. /*************************************************************/
  396. /* Name: min_OnClick
  397. /* Description: Minimize the window
  398. /*************************************************************/
  399. function min_OnClick()
  400. {
  401. //oHTA.windowState = "minimize";
  402. if (g_bUseWinProp == true)
  403. {
  404. WinProp.ShowWindow(6);
  405. }
  406. }
  407. /*************************************************************/
  408. /* Name: close_OnClick
  409. /* Description: Close the window
  410. /*************************************************************/
  411. function close_OnClick()
  412. {
  413. window.close();
  414. }
  415. /*************************************************************/
  416. /* Name: muteon
  417. /* Description: turn sound off
  418. /*************************************************************/
  419. function muteon()
  420. {
  421. SndCtl.Mute = true;
  422. Mute.style.display = '';
  423. NotMute.style.display = 'none';
  424. g_nButPos[8][4] = 'none'; //array from which OnResize() reads button attributes
  425. g_nButPos[9][4] = ''; //array from which OnResize() reads button attributes
  426. }
  427. /*************************************************************/
  428. /* Name: muteoff
  429. /* Description: turn sound on
  430. /*************************************************************/
  431. function muteoff()
  432. {
  433. SndCtl.Mute = false;
  434. Mute.style.display = 'none';
  435. NotMute.style.display = '';
  436. g_nButPos[8][4] = ''; //array from which OnResize() reads button attributes
  437. g_nButPos[9][4] = 'none'; //array from which OnResize() reads button attributes
  438. }
  439. /*************************************************************/
  440. /* Name: enhOn_onClick */
  441. /*************************************************************/
  442. function showEnh_onClick()
  443. {
  444. // state must be 2
  445. ChangeURL();
  446. SetEnhState(3);
  447. }
  448. /*************************************************************/
  449. /* Name: enhOff_onClick */
  450. /*************************************************************/
  451. function hideEnh_onClick()
  452. {
  453. // state must be 3
  454. SwitchOffEnhancement();
  455. SetEnhState(2);
  456. }
  457. /*************************************************************/
  458. /* Name: SetVolume
  459. /* Description: Sets the volume level
  460. /*************************************************************/
  461. function SetVolume(val)
  462. {
  463. SndCtl.Volume = val;
  464. }
  465. /*************************************************************/
  466. /* Name: ShowButtons
  467. /* Description: Unhides the button controls
  468. /*************************************************************/
  469. function ShowButtons()
  470. {
  471. ControlsDiv.style.display = '';
  472. }
  473. /*************************************************************/
  474. /* Name: Drag, StartDrag, StopDrag
  475. /* Description: Handles window moves
  476. /*************************************************************/
  477. var oldX;
  478. var oldY;
  479. var top;
  480. var left;
  481. function KeyUp()
  482. {
  483. ViewCtl.About();
  484. }
  485. /*************************************************************/
  486. /* Name: HandleError
  487. /* Description: Handles errors
  488. /*************************************************************/
  489. function HandleError(error)
  490. {
  491. r = "Script error "+ error + "\n" + error.srcText;
  492. if (error.line > 0)
  493. {
  494. r += "\nat line " + error.line + ", character " + error.linepos;
  495. }
  496. window.alert(r);
  497. }
  498. /**********************ATVEF stuff**************************/
  499. function HideBigI()
  500. {
  501. document.all.TheBigI.style.display = 'none';
  502. }
  503. function ShowBigI()
  504. {
  505. document.all.TheBigI.style.left = document.body.clientWidth - 80;
  506. document.all.TheBigI.style.top = ViewCtl.style.top;
  507. document.all.TheBigI.style.display = '';
  508. window.setTimeout("HideBigI()", g_iBigITimeOut);
  509. }
  510. /*************************************************************/
  511. /* Name: EnhancementNewHandler
  512. /*************************************************************/
  513. function EnhancementNewHandler(pEnh)
  514. {
  515. //window.alert("New Enhancement " + pEnh.SessionName);
  516. if (g_iEnhState != 0)
  517. {
  518. alert("Debug error: Enh available, recd new enhancement");
  519. return;
  520. }
  521. // State 0 -> whatever
  522. ProcessEnhancement(pEnh);
  523. }
  524. /*************************************************************/
  525. /* Name: EnhancementNewHandler
  526. /*************************************************************/
  527. function EnhancementUpdatedHandler(pEnh, flags)
  528. {
  529. //window.alert("Enhancement Updated " + pEnh.SessionName + " : " + flags);
  530. // Clear current enhancement, triggers etc
  531. SetEnhState(0);
  532. // State 0 -> whatever
  533. ProcessEnhancement(pEnh);
  534. }
  535. /*************************************************************/
  536. /* Name: EnhancementNewHandler
  537. /*************************************************************/
  538. function EnhancementExpiredHandler(pEnh)
  539. {
  540. //window.alert("Enhancement Expired "+ pEnh.SessionName);
  541. if (g_iEnhState < 1)
  542. {
  543. alert("Debug error: Enh not available, recd expired enhancement");
  544. return;
  545. }
  546. if (g_iEnhState == 3)
  547. {
  548. // State 3 -> 2
  549. SwitchOffEnhancement();
  550. }
  551. // State 2 -> 0
  552. SetEnhState(0);
  553. }
  554. /*************************************************************/
  555. /* Name: EnhancementNewHandler
  556. /*************************************************************/
  557. function TriggerNewHandler(pTrig, bActive)
  558. {
  559. // window.alert("New Trigger " + pTrig.Name + " " + pTrig.URL);
  560. if (g_iEnhState == 0) // no enhancement
  561. {
  562. alert("Debug error: received trigger but no enhancement available");
  563. return;
  564. }
  565. // The flowchart contains 3 checks here that we don't support
  566. if ((g_iEnhState == 1) || // g_pCurTrig is invalid
  567. (pTrig.URL != g_pCurTrig.URL))
  568. {
  569. if (pTrig.Name == "")
  570. {
  571. // Attempting to change URL, but trigger is nameless. Ignore.
  572. alert("Nameless trigger, ignored");
  573. return;
  574. }
  575. else
  576. {
  577. // For the demo assume all triggers are releasable
  578. //alert("New trigger " + pTrig.Name + " " + pTrig.URL);
  579. g_pCurTrig = pTrig;
  580. iPrevState = g_iEnhState;
  581. SetEnhState(2);
  582. ShowBigI();
  583. if ((g_bAutoEnhancement == true) ||
  584. (iPrevState == 3)) // We were already viewing atvef
  585. {
  586. ChangeURL();
  587. }
  588. }
  589. }
  590. //if (pTrig.Script != "")
  591. // alert(pTrig.Script);
  592. if (g_iEnhState == 3)
  593. document.frames("Atvef").window.execScript(pTrig.Script);
  594. /*
  595. // Come back to state 1
  596. if (g_iEnhState == 3)
  597. {
  598. SwitchOffEnhancement(); //Optimization, don't do
  599. SetEnhState(2);
  600. }
  601. if (g_iEnhState == 2)
  602. {
  603. SetEnhState(1);
  604. }
  605. // Now start going up again
  606. g_pCurTrig = pTrig;
  607. SetEnhState(2);
  608. ShowBigI();
  609. if (g_bAutoEnhancement == true)
  610. {
  611. // Automatically go from State 2 -> 3
  612. ProcessTrigger(pTrig);
  613. SetEnhState(3);
  614. }
  615. */
  616. }
  617. /*************************************************************/
  618. /* Name: EnhancementNewHandler
  619. /*************************************************************/
  620. function ChangeURL()
  621. {
  622. if (g_bIsVideoRunning == true)
  623. {
  624. // Hack! Since tv: does not tune to atvef content, let
  625. // video run in background and have a colorkeyed region
  626. // on the atvef page in place of the tv: object
  627. // pause_OnClick();
  628. // ViewCtl.style.display = 'none';
  629. }
  630. HideBigI();
  631. NavigateAtvefTo(g_pCurTrig.URL);
  632. document.all.Atvef.style.visibility = "visible";
  633. }
  634. /*************************************************************/
  635. /* Name: ProcessEnhancement */
  636. /*************************************************************/
  637. function ProcessEnhancement(pEnh)
  638. {
  639. // current state must be 0
  640. SetEnhState(1);
  641. g_pCurEnh = pEnh;
  642. }
  643. /*************************************************************/
  644. /* Name: SwitchOffEnhancement */
  645. /*************************************************************/
  646. function SwitchOffEnhancement()
  647. {
  648. // Switch to video
  649. document.all.Atvef.style.visibility = "hidden";
  650. // play_OnClick();
  651. ViewCtl.style.display = '';
  652. // Current state must be 3
  653. SetEnhState(2);
  654. }
  655. /*************************************************************/
  656. /* Name: Parse URL and navigate to it */
  657. /*************************************************************/
  658. function NavigateAtvefTo(strURL)
  659. {
  660. var strURL2;
  661. if (strURL.substr(0,3) == "lid")
  662. {
  663. strURL2 = "file://C:\\atveftemp\\" + strURL.substr(6);
  664. //alert("lid, " + strURL2);
  665. }
  666. else
  667. {
  668. strURL2 = strURL;
  669. //alert("regular, " + strURL2);
  670. }
  671. document.all.Atvef.src = strURL2;
  672. }
  673. /*************************************************************/
  674. /* Name: SetEnhState */
  675. /*************************************************************/
  676. function SetEnhState(newState)
  677. {
  678. if (newState == 0)
  679. {
  680. ShowEnh.style.display = 'none';
  681. //ShowEnhDisabled.style.display = 'none';
  682. HideEnh.style.display = 'none';
  683. }
  684. else if (newState == 1)
  685. {
  686. ShowEnh.style.display = 'none';
  687. //ShowEnhDisabled.style.display = '';
  688. HideEnh.style.display = 'none';
  689. }
  690. else if (newState == 2)
  691. {
  692. ShowEnh.style.display = '';
  693. //ShowEnhDisabled.style.display = 'none';
  694. HideEnh.style.display = 'none';
  695. }
  696. else if (newState == 3)
  697. {
  698. ShowEnh.style.display = 'none';
  699. //ShowEnhDisabled.style.display = 'none';
  700. HideEnh.style.display = '';
  701. }
  702. g_iEnhState = newState;
  703. }
  704. /*************************************************************/
  705. /* Name: SetAutoEnhance */
  706. /*************************************************************/
  707. function SetAutoEnhance()
  708. {
  709. if (g_bAutoEnhancement == true)
  710. {
  711. g_bAutoEnhancement = false;
  712. // autoEnh.value = "AutoEnhance on";
  713. }
  714. else
  715. {
  716. g_bAutoEnhancement = true;
  717. // autoEnh.value = "AutoEnhance off";
  718. if (g_iEnhState == 2)
  719. {
  720. ProcessTrigger(g_pCurTrig);
  721. SetEnhState(3);
  722. }
  723. }
  724. }
  725. </SCRIPT>
  726. <!--
  727. <HTA:APPLICATION ID="oHTA"
  728. APPLICATIONNAME="myApp"
  729. BORDER="none"
  730. BORDERSTYLE="normal"
  731. CAPTION="yes"
  732. ICON=""
  733. MAXIMIZEBUTTON="yes"
  734. MINIMIZEBUTTON="yes"
  735. SHOWINTASKBAR="yes"
  736. SINGLEINSTANCE="yes"
  737. SYSMENU="yes"
  738. VERSION="1.0"
  739. >
  740. -->
  741. <!--
  742. <DIV ID="WinPropDiv">
  743. <OBJECT ID="WinProp" CLASSID="CLSID:11F4496D-85B1-40D7-8919-D3DF5732A1CF"
  744. style="position:absolute;top=0;left=0">
  745. </OBJECT>
  746. </DIV>
  747. -->
  748. <OBJECT ID="TVProf" CLASSID="CLSID:EB24C040-9E6B-4469-A425-87DCCFFE4395">
  749. </OBJECT>
  750. <OBJECT ID="FullScCtl" CLASSID="CLSID:39FC3F46-F428-44D2-829B-74CD1DA76F44">
  751. </OBJECT>
  752. <OBJECT ID="SndCtl" CLASSID="CLSID:EFE22EF0-D363-4986-AC56-9989C61EC5E4">
  753. </OBJECT>
  754. <OBJECT id="AtvefRecv" ClassID="CLSID:79AF05FC-2378-11D3-BF62-00C04F8EC1B5">
  755. </OBJECT>
  756. <SCRIPT LANGUAGE="JScript" FOR=AtvefRecv EVENT="NotifyEnhancementNew(pEnh)">EnhancementNewHandler(pEnh)</SCRIPT>
  757. <SCRIPT LANGUAGE="JScript" FOR=AtvefRecv EVENT="NotifyEnhancementUpdated(pEnh, flags)">EnhancementUpdatedHandler(pEnh, flags)</SCRIPT>
  758. <SCRIPT LANGUAGE="JScript" FOR=AtvefRecv EVENT="NotifyEnhancementExpired(pEnh)">EnhancementExpiredHandler(pEnh)</SCRIPT>
  759. <SCRIPT LANGUAGE="JScript" FOR=AtvefRecv EVENT="NotifyTriggerNew(pTrig, active)">TriggerNewHandler(pTrig, active)</SCRIPT>
  760. <SCRIPT LANGUAGE="JScript" FOR=AtvefRecv EVENT="NotifyTriggerUpdated(pTrig, active, flags)">TriggerNewHandler(pTrig, active)</SCRIPT>
  761. <DIV id="ViewCtlDiv">
  762. <OBJECT ID="ViewCtl" style="display:none;position:absolute;"
  763. CLASSID="CLSID:B0EDF163-910A-11D2-B632-00C04F79498E">
  764. </OBJECT>
  765. </DIV>
  766. <SCRIPT LANGUAGE="JScript" FOR=ViewCtlDiv EVENT=OnClick>ShowButtons()</SCRIPT>
  767. <IFRAME id="Atvef"
  768. style="visibility:hidden;position:absolute;left:0;top:0;"
  769. marginheight=0
  770. marginwidth=0
  771. frameborder=0
  772. >
  773. </IFRAME>
  774. <IFRAME id="TheBigI"
  775. style="display:none;position:absolute;left:10;top:10;"
  776. marginheight=0
  777. marginwidth=0
  778. frameborder=0
  779. width=48
  780. height=48
  781. src="bigi.htm"
  782. scrolling=no
  783. >
  784. </IFRAME>
  785. <DIV id=ControlsDiv style="visibility:hidden;zindex:2;">
  786. <OBJECT ID="Maximize" style="display:none;position:absolute;"
  787. CLASSID="CLSID:7A136DD3-BEBE-47BE-B6D9-E2CC7F816D43"
  788. WIDTH=30 HEIGHT=30 >
  789. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  790. <PARAM NAME="ImageStatic" VALUE="IDR_STATIC_MAX">
  791. <PARAM NAME="ImageHover" VALUE="IDR_HOVER_MAX">
  792. <PARAM NAME="ImagePush" VALUE="IDR_DOWN_MAX">
  793. <PARAM NAME="ToolTip" VALUE="Maximize">
  794. <PARAM NAME="ToolTipMaxWidth" VALUE="130">
  795. <PARAM NAME="TransparentBlitType" VALUE="1">
  796. <PARAM NAME="Windowless" VALUE="0">
  797. <PARAM NAME="BackColor" VALUE="16711935">
  798. </OBJECT>
  799. <SCRIPT LANGUAGE="JScript" FOR=Maximize EVENT=OnClick>max_OnClick()</SCRIPT>
  800. <OBJECT ID="Restore" style="display:none;position:absolute;"
  801. CLASSID="CLSID:7A136DD3-BEBE-47BE-B6D9-E2CC7F816D43"
  802. WIDTH=30 HEIGHT=30 >
  803. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  804. <PARAM NAME="ImageStatic" VALUE="IDR_STATIC_RESTORE">
  805. <PARAM NAME="ImageHover" VALUE="IDR_HOVER_RESTORE">
  806. <PARAM NAME="ImagePush" VALUE="IDR_DOWN_RESTORE">
  807. <PARAM NAME="ToolTip" VALUE="Restore">
  808. <PARAM NAME="ToolTipMaxWidth" VALUE="130">
  809. <PARAM NAME="TransparentBlitType" VALUE="1">
  810. <PARAM NAME="Windowless" VALUE="0">
  811. <PARAM NAME="BackColor" VALUE="16711935">
  812. </OBJECT>
  813. <SCRIPT LANGUAGE="JScript" FOR=Restore EVENT=OnClick>restore_OnClick()</SCRIPT>
  814. <OBJECT ID="Minimize" style="display:none;position:absolute;"
  815. CLASSID="CLSID:7A136DD3-BEBE-47BE-B6D9-E2CC7F816D43"
  816. WIDTH=30 HEIGHT=30 >
  817. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  818. <PARAM NAME="ImageStatic" VALUE="IDR_STATIC_MIN">
  819. <PARAM NAME="ImageHover" VALUE="IDR_HOVER_MIN">
  820. <PARAM NAME="ImagePush" VALUE="IDR_DOWN_MIN">
  821. <PARAM NAME="ToolTip" VALUE="Minimize">
  822. <PARAM NAME="ToolTipMaxWidth" VALUE="130">
  823. <PARAM NAME="TransparentBlitType" VALUE="1">
  824. <PARAM NAME="Windowless" VALUE="0">
  825. <PARAM NAME="BackColor" VALUE="16711935">
  826. </OBJECT>
  827. <SCRIPT LANGUAGE="JScript" FOR=Minimize EVENT=OnClick>min_OnClick()</SCRIPT>
  828. <OBJECT ID="Close" style="display:none;position:absolute;"
  829. CLASSID="CLSID:7A136DD3-BEBE-47BE-B6D9-E2CC7F816D43"
  830. WIDTH=30 HEIGHT=30 >
  831. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  832. <PARAM NAME="ImageStatic" VALUE="IDR_STATIC_CLOSE">
  833. <PARAM NAME="ImageHover" VALUE="IDR_HOVER_CLOSE">
  834. <PARAM NAME="ImagePush" VALUE="IDR_DOWN_CLOSE">
  835. <PARAM NAME="ToolTip" VALUE="Close">
  836. <PARAM NAME="ToolTipMaxWidth" VALUE="130">
  837. <PARAM NAME="TransparentBlitType" VALUE="1">
  838. <PARAM NAME="Windowless" VALUE="0">
  839. <PARAM NAME="BackColor" VALUE="16711935">
  840. </OBJECT>
  841. <SCRIPT LANGUAGE="JScript" FOR=Close EVENT=OnClick>close_OnClick()</SCRIPT>
  842. <OBJECT ID="Pause" style="display:none;position:absolute;"
  843. CLASSID="CLSID:7A136DD3-BEBE-47BE-B6D9-E2CC7F816D43"
  844. WIDTH=30 HEIGHT=30 >
  845. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  846. <PARAM NAME="ImageStatic" VALUE="IDR_FULLSTATIC_PAUSE">
  847. <PARAM NAME="ImageHover" VALUE="IDR_FULLHOVER_PAUSE">
  848. <PARAM NAME="ImagePush" VALUE="IDR_FULLDOWN_PAUSE">
  849. <PARAM NAME="ToolTip" VALUE="Pause">
  850. <PARAM NAME="ToolTipMaxWidth" VALUE="130">
  851. <PARAM NAME="TransparentBlitType" VALUE="1">
  852. <PARAM NAME="Windowless" VALUE="0">
  853. <PARAM NAME="BackColor" VALUE="16711935">
  854. </OBJECT>
  855. <SCRIPT LANGUAGE="JScript" FOR=Pause EVENT=OnClick>pause_OnClick()</SCRIPT>
  856. <OBJECT ID="Play" style="display:none;position:absolute;"
  857. CLASSID="CLSID:7A136DD3-BEBE-47BE-B6D9-E2CC7F816D43"
  858. WIDTH=30 HEIGHT=30 >
  859. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  860. <PARAM NAME="ImageStatic" VALUE="IDR_FULLSTATIC_PLAY">
  861. <PARAM NAME="ImageHover" VALUE="IDR_FULLHOVER_PLAY">
  862. <PARAM NAME="ImagePush" VALUE="IDR_FULLDOWN_PLAY">
  863. <PARAM NAME="ToolTip" VALUE="Play">
  864. <PARAM NAME="ToolTipMaxWidth" VALUE="130">
  865. <PARAM NAME="TransparentBlitType" VALUE="1">
  866. <PARAM NAME="Windowless" VALUE="0">
  867. <PARAM NAME="BackColor" VALUE="16711935">
  868. </OBJECT>
  869. <SCRIPT LANGUAGE="JScript" FOR=Play EVENT=OnClick>play_OnClick()</SCRIPT>
  870. <OBJECT ID="Rewind" style="display:none;position:absolute;"
  871. CLASSID="CLSID:7A136DD3-BEBE-47BE-B6D9-E2CC7F816D43"
  872. WIDTH=30 HEIGHT=30 >
  873. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  874. <PARAM NAME="ImageStatic" VALUE="IDR_STATIC_CHANNELDOWN">
  875. <PARAM NAME="ImageHover" VALUE="IDR_HOVER_CHANNELDOWN">
  876. <PARAM NAME="ImagePush" VALUE="IDR_DOWN_CHANNELDOWN">
  877. <PARAM NAME="ToolTip" VALUE="Rewind">
  878. <PARAM NAME="ToolTipMaxWidth" VALUE="130">
  879. <PARAM NAME="TransparentBlitType" VALUE="1">
  880. <PARAM NAME="Windowless" VALUE="0">
  881. <PARAM NAME="BackColor" VALUE="16711935">
  882. </OBJECT>
  883. <SCRIPT LANGUAGE="JScript" FOR=Rewind EVENT=OnClick>rew_OnClick()</SCRIPT>
  884. <OBJECT ID="FastForward" style="display:none;position:absolute;"
  885. CLASSID="CLSID:7A136DD3-BEBE-47BE-B6D9-E2CC7F816D43"
  886. WIDTH=30 HEIGHT=30 >
  887. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  888. <PARAM NAME="ImageStatic" VALUE="IDR_STATIC_CHANNELUP">
  889. <PARAM NAME="ImageHover" VALUE="IDR_HOVER_CHANNELUP">
  890. <PARAM NAME="ImagePush" VALUE="IDR_DOWN_CHANNELUP">
  891. <PARAM NAME="ToolTip" VALUE="FastForward">
  892. <PARAM NAME="ToolTipMaxWidth" VALUE="130">
  893. <PARAM NAME="TransparentBlitType" VALUE="1">
  894. <PARAM NAME="Windowless" VALUE="0">
  895. <PARAM NAME="BackColor" VALUE="16711935">
  896. </OBJECT>
  897. <SCRIPT LANGUAGE="JScript" FOR=FastForward EVENT=OnClick>fwd_OnClick()</SCRIPT>
  898. <OBJECT ID="NotMute" style="display:none;position:absolute;"
  899. CLASSID="CLSID:7A136DD3-BEBE-47BE-B6D9-E2CC7F816D43"
  900. WIDTH=30 HEIGHT=30 >
  901. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  902. <PARAM NAME="ImageStatic" VALUE="IDR_STATIC_SOUND">
  903. <PARAM NAME="ImageHover" VALUE="IDR_HOVER_SOUND">
  904. <PARAM NAME="ImagePush" VALUE="IDR_DOWN_SOUND">
  905. <PARAM NAME="ToolTip" VALUE="Mute">
  906. <PARAM NAME="ToolTipMaxWidth" VALUE="130">
  907. <PARAM NAME="TransparentBlitType" VALUE="1">
  908. <PARAM NAME="Windowless" VALUE="0">
  909. <PARAM NAME="BackColor" VALUE="16711935">
  910. </OBJECT>
  911. <SCRIPT LANGUAGE="JScript" FOR=NotMute EVENT=OnClick>muteon()</SCRIPT>
  912. <OBJECT ID="Mute" style="display:none;position:absolute;"
  913. CLASSID="CLSID:7A136DD3-BEBE-47BE-B6D9-E2CC7F816D43"
  914. WIDTH=30 HEIGHT=30 >
  915. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  916. <PARAM NAME="ImageStatic" VALUE="IDR_FULLSTATIC_MUTE">
  917. <PARAM NAME="ImageHover" VALUE="IDR_HOVER_MUTE">
  918. <PARAM NAME="ImagePush" VALUE="IDR_DOWN_MUTE">
  919. <PARAM NAME="ToolTip" VALUE="Turn Sound On">
  920. <PARAM NAME="ToolTipMaxWidth" VALUE="130">
  921. <PARAM NAME="TransparentBlitType" VALUE="1">
  922. <PARAM NAME="Windowless" VALUE="0">
  923. <PARAM NAME="BackColor" VALUE="16711935">
  924. </OBJECT>
  925. <SCRIPT LANGUAGE="JScript" FOR=Mute EVENT=OnClick>muteoff()</SCRIPT>
  926. <OBJECT ID="VolSlider" style="display:none;position:absolute;"
  927. CLASSID="CLSID:E2909DE3-0EE0-46E6-9258-E1CFE5AC73F9"
  928. WIDTH=30 HEIGHT=30 >
  929. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  930. <PARAM NAME="BackStatic" VALUE="IDR_STATIC_VOLSLIDER">
  931. <PARAM NAME="BackHover" VALUE="IDR_HOVER_VOLSLIDER">
  932. <PARAM NAME="BackPush" VALUE="IDR_DOWN_VOLSLIDER">
  933. <PARAM NAME="ThumbStatic" VALUE="IDR_STATIC_VOLTHUMB">
  934. <PARAM NAME="ThumbHover" VALUE="IDR_HOVER_VOLTHUMB">
  935. <PARAM NAME="ThumbPush" VALUE="IDR_DOWN_VOLTHUMB">
  936. <PARAM NAME="ToolTip" VALUE="Volume">
  937. <PARAM NAME="ToolTipMaxWidth" VALUE="130">
  938. <PARAM NAME="Windowless" VALUE="0">
  939. <PARAM NAME="BackColor" VALUE="16711935">
  940. </OBJECT>
  941. <SCRIPT LANGUAGE="JScript" FOR=VolSlider EVENT=OnValueChange>SetVolume(VolSlider.Value)</SCRIPT>
  942. <OBJECT ID="ShowEnhDisabled" style="display:none;position:absolute;"
  943. CLASSID="CLSID:7A136DD3-BEBE-47BE-B6D9-E2CC7F816D43"
  944. WIDTH=30 HEIGHT=30 >
  945. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  946. <PARAM NAME="ImageStatic" VALUE="IDR_DISABLED_ENHANCE">
  947. <PARAM NAME="ImageHover" VALUE="IDR_DISABLED_ENHANCE">
  948. <PARAM NAME="ImagePush" VALUE="IDR_DISABLED_ENHANCE">
  949. <PARAM NAME="ToolTip" VALUE="Waiting for trigger">
  950. <PARAM NAME="ToolTipMaxWidth" VALUE="130">
  951. <PARAM NAME="TransparentBlitType" VALUE="1">
  952. <PARAM NAME="Windowless" VALUE="0">
  953. <PARAM NAME="BackColor" VALUE="16711935">
  954. </OBJECT>
  955. <OBJECT ID="ShowEnh" style="display:none;position:absolute;"
  956. CLASSID="CLSID:7A136DD3-BEBE-47BE-B6D9-E2CC7F816D43"
  957. WIDTH=30 HEIGHT=30 >
  958. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  959. <PARAM NAME="ImageStatic" VALUE="IDR_STATIC_ENHANCE">
  960. <PARAM NAME="ImageHover" VALUE="IDR_HOVER_ENHANCE">
  961. <PARAM NAME="ImagePush" VALUE="IDR_DOWN_ENHANCE">
  962. <PARAM NAME="ToolTip" VALUE="Show enhancement">
  963. <PARAM NAME="ToolTipMaxWidth" VALUE="130">
  964. <PARAM NAME="TransparentBlitType" VALUE="1">
  965. <PARAM NAME="Windowless" VALUE="0">
  966. <PARAM NAME="BackColor" VALUE="16711935">
  967. </OBJECT>
  968. <SCRIPT LANGUAGE="JScript" FOR=ShowEnh EVENT=OnClick>showEnh_onClick()</SCRIPT>
  969. <OBJECT ID="HideEnh" style="display:none;position:absolute;"
  970. CLASSID="CLSID:7A136DD3-BEBE-47BE-B6D9-E2CC7F816D43"
  971. WIDTH=30 HEIGHT=30 >
  972. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  973. <PARAM NAME="ImageStatic" VALUE="IDR_STATIC_ENHANCE">
  974. <PARAM NAME="ImageHover" VALUE="IDR_HOVER_ENHANCE">
  975. <PARAM NAME="ImagePush" VALUE="IDR_DOWN_ENHANCE">
  976. <PARAM NAME="ToolTip" VALUE="Switch off enhancement">
  977. <PARAM NAME="ToolTipMaxWidth" VALUE="130">
  978. <PARAM NAME="TransparentBlitType" VALUE="1">
  979. <PARAM NAME="Windowless" VALUE="0">
  980. <PARAM NAME="BackColor" VALUE="16711935">
  981. </OBJECT>
  982. <SCRIPT LANGUAGE="JScript" FOR=HideEnh EVENT=OnClick>hideEnh_onClick()</SCRIPT>
  983. <!--
  984. <OBJECT ID="AutoEnhancement" style="display:none;position:absolute;"
  985. CLASSID="CLSID:7A136DD3-BEBE-47BE-B6D9-E2CC7F816D43"
  986. WIDTH=30 HEIGHT=30 >
  987. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  988. <PARAM NAME="ImageStatic" VALUE="IDR_FULLSTATIC_MENU">
  989. <PARAM NAME="ImageHover" VALUE="IDR_FULLHOVER_MENU">
  990. <PARAM NAME="ImagePush" VALUE="IDR_FULLDOWN_MENU">
  991. <PARAM NAME="ToolTip" VALUE="Show Enhancement">
  992. <PARAM NAME="ToolTipMaxWidth" VALUE="130">
  993. <PARAM NAME="TransparentBlitType" VALUE="1">
  994. <PARAM NAME="Windowless" VALUE="0">
  995. <PARAM NAME="BackColor" VALUE="16711935">
  996. </OBJECT>
  997. <SCRIPT LANGUAGE="JScript" FOR=Enhancement EVENT=OnClick>SetAutoEnhance()</SCRIPT>
  998. -->
  999. <OBJECT ID="ChannelNumberTextBox" style="display:none;position:absolute;"
  1000. CLASSID="CLSID:F2A6C42D-5515-4013-85F4-1EC3D33950DA"
  1001. WIDTH=30 HEIGHT=30 >
  1002. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  1003. <PARAM NAME="Windowless" VALUE="0">
  1004. <PARAM NAME="BackColor" VALUE="16711935">
  1005. </OBJECT>
  1006. </DIV> <!-- parent of all buttons, sliders, textbox -->
  1007. <OBJECT ID="StatusBar" style="display:show;position:absolute;top:300;left:300;"
  1008. CLASSID="CLSID:F2A6C42D-5515-4013-85F4-1EC3D33950DA"
  1009. WIDTH=150 HEIGHT=30 >
  1010. <PARAM NAME="ResourceDll" VALUE="msmfcnt.dll">
  1011. <PARAM NAME="Windowless" VALUE="0">
  1012. <PARAM NAME="BackColor" VALUE="0">
  1013. </OBJECT>
  1014. <span id=GUIDNULL style="display:none;zindex:4;">{00000000-0000-0000-0000-000000000000}</span>
  1015. <span id=GUIDTV style="display:none;zindex:5">{a799a800-a46d-11d0-a18c-00a02401dcd4}</span>
  1016. </BODY>
  1017. </HTML>