playing from a urls in a database

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
richard6235
Blank Cone
Blank Cone
Posts: 11
Joined: 07 Feb 2011 10:59

playing from a urls in a database

Postby richard6235 » 15 Mar 2011 15:20

Hey
I have a database with udp streams like so -> udp://@239.100.1.1:4422, Using a PHP script to get the stream as a string onto the webpage how would I then play this stream in VLC object?

I have already got these streams to play by manually adding them into the playlist, but my client has told me the streams may change hence the database.

Thanks

Ric

TKE
New Cone
New Cone
Posts: 1
Joined: 12 Apr 2011 06:30

Re: playing from a urls in a database

Postby TKE » 12 Apr 2011 06:31

I am also interested in this answer.

lightfighter
New Cone
New Cone
Posts: 4
Joined: 14 Apr 2011 18:12

Re: playing from a urls in a database

Postby lightfighter » 14 Apr 2011 18:31

Hi there,

There was another post that answered your question, but it only has the Play and Stop buttons. I can't figure out how to add Pause or Fullscreen, or any other controls. However, since you said you are using PHP from a database, here is the code modified to pull the movie from a database.

Code: Select all

<script language="javascript"> function play(obj, uri) { var obj = document.getElementById(obj); obj.playlist.add(uri,uri, ""); obj.playlist.play(); } function stop(obj) { var obj = document.getElementById(obj); obj.playlist.stop(); } function pause(obj) { var obj = document.getElementById(obj); obj.playlist.pause(); } function init() { play('vlc1', 'http://<?php echo $address; ?>/<?php echo $row['alias']; ?>/<?php echo $row['link']; ?>'); } </script> <OBJECT> <embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" width="500" height="480" rtsp-caching="80" id="vlc1"> </embed> </OBJECT> <button onclick="play('vlc1', 'http://<?php echo $address; ?>/<?php echo $row['alias']; ?>/<?php echo $row['link']; ?>');">start</button> <button onclick="pause('vlc1');">pause</button> <button onclick="stop('vlc1');">stop</button>
I've got the variable "address" set to be the IP address of the host, and the variable "alias" set to be the external hard drive the movie is on, and the variable "link" set to be the file name. You can easially change these to suit your needs, by changing the http: address using your own php variables.


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 7 guests