Posting a Video

Discussion in 'PHP' started by bartolay13, May 4, 2008.

  1. #1
    How to Play, Stop, Choose a video in php??
     
    bartolay13, May 4, 2008 IP
  2. vishnups

    vishnups Banned

    Messages:
    166
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can by using a mix of PHP and Javascript and depends on the player that you use.. Something like
    
    <script type="text/javascript">
    	var currentPosition;
    	var currentVolume;
    	var currentItem;
    	function sendEvent(typ,prm) { thisMovie("mpl").sendEvent(typ,prm); };
    	function getUpdate(typ,pr1,pr2,pid) {
    		if(typ == "time") { currentPosition = pr1; }
    		else if(typ == "volume") { currentVolume = pr1; }
    		else if(typ == "item") { currentItem = pr1; setTimeout("(currentItem)",100); }
    		var id = document.getElementById(typ);
    		id.innerHTML = typ+ ": "+Math.round(pr1);
    		pr2 == undefined ? null: id.innerHTML += ", "+Math.round(pr2);
    		if(pid != "null") {
    			document.getElementById("pid").innerHTML = "(received from the player with id <i>"+pid+"</i>)";
    		}
    	};
    	function loadFile(obj) { thisMovie("mpl").loadFile(obj); };
    	function addItem(obj,idx) { thisMovie("mpl").addItem(obj,idx); }
    	function removeItem(idx) { thisMovie("mpl").removeItem(idx); }
    	function getItemData(idx) {
    		var obj = thisMovie("mpl").itemData(idx);
    		var nodes = "";
    		for(var i in obj) {
    			nodes += "<li>"+i+": "+obj[i]+"</li>";
    		}
    		document.getElementById("data").innerHTML = nodes;
    	};
    	function thisMovie(movieName) {
    	    if(navigator.appName.indexOf("Microsoft") != -1) {
    			return window[movieName];
    		} else {
    			return document[movieName];
    		}
    	};
    </script>
    
    Code (markup):
    and calling it like
    <a href="javascript:sendEvent('playpause')"><b><u>Click to Play/Pause this video</u></b></a>
     
    vishnups, May 5, 2008 IP
  3. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #3
    nc... ill try this one...
     
    bartolay13, May 5, 2008 IP