kisaragi Posted February 13, 2007 Share Posted February 13, 2007 Hello.. First off i'm new here and new to php and hoping i could get some help.. it has been thrust upon me in my office to learn and update the site web page which was writen by someone else who has knowledge of php and swf. I having know php knowledge am cutting my way through as best as possible. but i have come across this road block i can't seem to cross. There is and embedded swf video player that plays site videos on a random loop.. I have been requested to have this player stop playing the loop upon a click of any of the tabs on the page.. here is the scripting as i know it so far that is on the page currently. This loads the video player <iframe src="./video/video.php" height=285 width=320 frameborder=0 border=0 name="fvp"></iframe> This is the video player it loads <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html40/loose.dtd"> <html> <head> <title>videoplayerclassic</title> <meta http-equiv="Content-Type" content="text/html; charset=shift_jis"> <meta name="author" content=""> <meta name="generator" content="SWiSHmax http://www.swishzone.com"> <meta name="description" content="videoplayerclassic"> <meta name="keywords" content="ashley, ingram, music, player, school, video"> <script src="./mpl.js" type="text/javascript"></script> </head> <body bgcolor="#ffffff" topmargin="0" leftmargin="0" bottommargin="0" rightmargin="0"> <left> <?php function counter($v_path){ $v_path = str_replace("./vdo/", "./cnt/", $v_path); $v_path = str_replace(".swf", ".dat", $v_path); if (file_exists($v_path)) { $yomiko=file($v_path); $fp = @fopen($v_path, "r+"); flock($fp, 2); $yomiko[0]++; fputs($fp, $yomiko[0]); flock($fp, 3); fclose($fp); } else { $ret = touch($v_path); $datap = file($v_path); $fp = @fopen($v_path, "r+"); flock($fp, 2); fputs($fp, "1"); flock($fp, 3); fclose($fp); }; }; $va = $_REQUEST["va"]; if ($va != ""){ $va = str_replace("video/" , "" , $va); echo" <script type=\"text/javascript\"> <!-- mpw(\"$va\"); // --> </script> "; counter($va); } else { $data = file("data.txt"); $newdata = Array(); for($i=0;$i<sizeof($data);$i++){ list($videoa,$pica,$videon,$videod) = explode("<>",$data[$i]); $newdata[$i] = "$videoa"; }; shuffle($newdata); $address = $newdata[0]; $address = str_replace("video/" , "" , $address); echo" <script type=\"text/javascript\"> <!-- mpw(\"$address\"); // --> </script> "; }; ?> </left> </body> </html> and within the video player it loads the background swf function mpw(ura){ document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" id=\"videoplayerclassic\" width=\"320\" height=\"284\">\n'); document.write('<param name=\"movie\" value=\"videoplayerclassic.swf\">\n'); document.write('<param name=\"bgcolor\" value=\"#EEEEEE\">\n'); document.write('<param name=\"quality\" value=\"high\">\n'); document.write('<param name=\"allowscriptaccess\" value=\"samedomain\">\n'); document.write('<PARAM NAME=FlashVars VALUE=\"vaddress=' + ura + '\">\n'); document.write('<embed type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" name=\"videoplayerclassic\" width=\"320\" height=\"284\" src=\"videoplayerclassic.swf\" FlashVars=\"vaddress=' + ura + '\" bgcolor=\"#EEEEEE\" quality=\"high\" swliveconnect=\"true\" allowscriptaccess=\"samedomain\">\n'); document.write('<noembed>\n'); document.write('</noembed>\n'); document.write('</embed>\n'); document.write('</object>\n'); } within the video player it requests information on the videos from a data.txt as follows ./video/vdo/20061208120543.swf<>./video/pic/20070118114131.jpg<>Manami - Natural Woman<>3?07?<>0 ./video/vdo/20061208122433.swf<>./video/pic/20061208122433.jpg<>Rina<>7?31?<>0 ./video/vdo/20061208123216.swf<>./video/pic/20061208123216.jpg<>Hanako<>7?26?<>0 ./video/vdo/20061208123703.swf<>./video/pic/20061208015334.jpg<>Nobuko - Safe<>3?14?<>0 ./video/vdo/20061208124616.swf<>./video/pic/20061208124616.jpg<>Yumi<>8?13?<>0 ./video/vdo/20061208125004.swf<>./video/pic/20061208015311.jpg<>Taeko<>3?36?<>0 ./video/vdo/20061208125430.swf<>./video/pic/20061208125430.jpg<>Akiko<>4?13?<>0 ./video/vdo/20061216075503.swf<>./video/pic/20061221094308.jpg<>Ashley Ingram - You’re The One<>4?56?<>0 ./video/vdo/20061221113135.swf<>./video/pic/20061221113135.jpg<>Kaori - Unbreak My Heart<>4?39?<>0 ./video/vdo/20070108063112.swf<>./video/pic/20070108063112.jpg<>Tomoko Koizumi - 8 Month Journey<>4?19?<>0 The tabs are defined by <?php require("nakami/waku.txt"); ?> which gets it's informations from the waku.txt as follows <?php function henkan($url){ $text = file_get_contents($url); $ttxt = nl2br($text); $ttxt = str_replace("\r\n", "\r", $ttxt); $ttxt = str_replace("\r", "\n", $ttxt); $ttxt = str_replace("\n", "", $ttxt); $ttxt = str_replace("<br />", "", $ttxt); echo($ttxt); }; ?> <script type="text/javascript"> <!-- if (document.images) { btn0 = new Image(); btn0.src = "nakami/img/0n.gif"; btn1 = new Image(); btn1.src = "nakami/img/a1r.gif"; btn2 = new Image(); btn2.src = "nakami/img/a2.gif"; btn3 = new Image(); btn3.src = "nakami/img/a3.gif"; btn4 = new Image(); btn4.src = "nakami/img/a6.gif"; btn5 = new Image(); btn5.src = "nakami/img/a5.gif"; btn6 = new Image() btn6.src = "nakami/img/a4.gif"; btn0a = new Image(); btn0a.src = "nakami/img/0n.gif"; btn1a = new Image(); btn1a.src = "nakami/img/a1r.gif"; btn2a = new Image(); btn2a.src = "nakami/img/a2.gif"; btn3a = new Image(); btn3a.src = "nakami/img/a3.gif"; btn4a = new Image(); btn4a.src = "nakami/img/a6.gif"; btn5a = new Image(); btn5a.src = "nakami/img/a5.gif"; btn6a = new Image() btn6a.src = "nakami/img/a4.gif"; } function setImage(name, src) { if (document.images) { document.images['btn0'].src = 'nakami/img/0n.gif'; document.images['btn1'].src = 'nakami/img/1r.gif'; document.images['btn2'].src = 'nakami/img/2.gif'; document.images['btn3'].src = 'nakami/img/3.gif'; document.images['btn4'].src = 'nakami/img/6.gif'; document.images['btn5'].src = 'nakami/img/5.gif'; document.images['btn6'].src = 'nakami/img/4.gif'; document.images['btn0a'].src = 'nakami/img/0n.gif'; document.images['btn1a'].src = 'nakami/img/1r.gif'; document.images['btn2a'].src = 'nakami/img/2.gif'; document.images['btn3a'].src = 'nakami/img/3.gif'; document.images['btn4a'].src = 'nakami/img/6.gif'; document.images['btn5a'].src = 'nakami/img/5.gif'; document.images['btn6a'].src = 'nakami/img/4.gif'; document.images[name].src = src; } } // --> </script> <script language="JavaScript"> <!-- var ns4=document.layers?1:0 var ie=document.all?1:0 var ns6=document.getElementById&&!document.all?1:0 var IsInit = 0 var tabcont=new Array() tabcont[0]='<?php henkan("nakami/intro.txt")?>' tabcont[1]='<?php require("nakami/project.php");?>' tabcont[2]='<?php henkan("nakami/course.txt") ?>' tabcont[3]='<?php henkan("nakami/koe.txt") ?>' tabcont[4]='<?php henkan("nakami/news.txt") ?>' tabcont[5]='<?php henkan("nakami/lang.txt") ?>' tabcont[6]='<?php henkan("nakami/gaiyo.txt") ?>' var subobj="" function showit(tabnum) { currentCont=(tabnum==-1)?"":tabcont[tabnum] if (ns4) { subobj=document.contArea1.document.contArea2 subobj.document.write(currentCont) subobj.document.close() } else if (ie||ns6) { subobj=ns6?document.getElementById("contArea3"):document.all.contArea3 subobj.innerHTML=currentCont } if (IsInit==0) { IsInit=1 } } //--> </script> <script language="JavaScript"> // Use a variable to reference the embedded SWF file. var flashVideoPlayer; /* When the HTML page loads (through the onLoad event of the <body> tag), it calls the initialize() function. */ function initialize() { var isIE = navigator.appName.indexOf("Microsoft") != -1; flashVideoPlayer = (isIE) ? window['videoPlayerClassic'] : document['videoPlayerClassic']; } function callFlashPlayPauseVideo() { flashVideoPlayer.pauseResume(); } function pauseMe() { initialize(); callFlashPlayPauseVideo(); } </script> <table width="700" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td><a href="" onclick="setImage('btn0', 'nakami/img/a0n.gif');showit(0);return false;"><img name="btn0" src="nakami/img/a0n.gif" border="0"></a></td> <td><a href="" onclick="setImage('btn1', 'nakami/img/a1r.gif');showit(1);return false;"><img name="btn1" src="nakami/img/1r.gif" border="0"></a></td> <td><a href="" onclick="setImage('btn2', 'nakami/img/a2.gif');showit(2);return false;"><img name="btn2" src="nakami/img/2.gif" border="0"></a></td> <td><a href="" onclick="setImage('btn3', 'nakami/img/a3.gif');showit(3);return false;"><img name="btn3" src="nakami/img/3.gif" border="0"></a></td> <td><a href="" onclick="setImage('btn4', 'nakami/img/a6.gif');showit(4);return false;"><img name="btn4" src="nakami/img/6.gif" border="0"></a></td> <td><a href="" onclick="setImage('btn5', 'nakami/img/a5.gif');showit(5);return false;"><img name="btn5" src="nakami/img/5.gif" border="0"></a></td> <td><a href="" onclick="setImage('btn6', 'nakami/img/a4.gif');showit(6);return false;"><img name="btn6" src="nakami/img/4.gif" border="0"></a></td> </tr> </table> </td> </tr> <tr> <td> <table width="700" border="0" cellpadding="0" cellspacing="0" bgcolor="#f7efe7"> <tr height="16"></tr> <tr> <td> <div class="frm" onload="showit(0)"> <!--------------------------------- ?{?¶?\?¦?p???C???[?Ì?T?C?Y?ð?w?è?iNN4?p?j --------------------------> <ilayer name="contArea1" width="700" height="800"> <layer name="contArea2" width="700" height="800"></layer> </ilayer> <div id="contArea3"></div> </div></td></tr></table> </td> </tr> </table> <table width="700" border="0" cellpadding="0" cellspacing="0"> <tr> <td><table border="0" cellpadding="0" cellspacing="0"> <tr> <td><a href="" onclick="setImage('btn0a', 'nakami/img/a0n.gif');showit(0);return false;"><img name="btn0a" src="nakami/img/a0n.gif" border="0"></a></td> <td><a href="" onclick="setImage('btn1a', 'nakami/img/a1r.gif');showit(1);return false;"><img name="btn1a" src="nakami/img/1r.gif" border="0"></a></td> <td><a href="" onclick="setImage('btn2a', 'nakami/img/a2.gif');showit(2);return false;"><img name="btn2a" src="nakami/img/2.gif" border="0"></a></td> <td><a href="" onclick="setImage('btn3a', 'nakami/img/a3.gif');showit(3);return false;"><img name="btn3a" src="nakami/img/3.gif" border="0"></a></td> <td><a href="" onclick="setImage('btn4a', 'nakami/img/a6.gif');showit(4);return false;"><img name="btn4a" src="nakami/img/6.gif" border="0"></a></td> <td><a href="" onclick="setImage('btn5a', 'nakami/img/a5.gif');showit(5);return false;"><img name="btn5a" src="nakami/img/5.gif" border="0"></a></td> <td><a href="" onclick="setImage('btn6a', 'nakami/img/a4.gif');showit(6);return false;"><img name="btn6a" src="nakami/img/4.gif" border="0"></a></td> </tr> </table></td> </tr> </table> I need the player to stop playing video when any one of the tabs (btn0 through btn6 or btn0a through btn6a) are clicked. Is this possible? If so I am requesting any help and requesting what changes to the scripting need to be made. I will thank ahead of time to anyone who can provide me with some insite.. Don't know if this will help the structure of the page is as follows index php page loads a left panel page through txt video play in this section loads a center panel trhough txt with the tabs 7 tabs load pages within the center panel from txt files would like the video in the left panel to stop when any tab is clicked in the center panel Also side issue center panel has 7 tabs across the top and the 7 tabs duplicated across the bottom defined as indepenant btns for all 14 would like both top 7 & the bottom 7 btns to mirror basically when btn0 clicked btn0a also changes to match when btn1 clicked btn1a also changes to match and so on to btn6 and vice versa when btn0a clicked btn0 also changes to match when btn1a clicked btn1 also changes to match and so on to btn6a thank you Link to comment https://forums.phpfreaks.com/topic/38262-how-to-have-swf-video-playback-on-site-tab-click/ Share on other sites More sharing options...
fert Posted February 13, 2007 Share Posted February 13, 2007 this is done in Javascript or flash, not php Link to comment https://forums.phpfreaks.com/topic/38262-how-to-have-swf-video-playback-on-site-tab-click/#findComment-183323 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.