I am a new person to VLC appliaction development.
I have written some PHP scripts to execute my video in the streaming server.
For video i have different port and for audio i have another port.
When i am doing onclick from PHP scripts to execute the video,it works fine.
The audio and video works nicely in different ports.
After the completion of video,the video again restarts automatically in my firefox browser.
But the sound is not working at this time.
I think the video is getting played from cache.
Let me know how to reslove this issue.
I am attaching the code over here which i am using for VLC streaming:
Code in index.php
Code: Select all
<div id="video">
<embed type="application/x-vlc-plugin"
name="video1"
autoplay="yes"
loop="yes"
hidden="no"
target="rtp://@239.255.1.1:<?= $port ?>"
width="1024" height="660"
style="position: absolute; top: 0; left: 0;" />
Code: Select all
function vlc_playFile($file, $enqueue = false, $target)
{
$port = getPort($target);
$FileHandle = fopen("play_title", 'w');
if($enqueue == false)
{
$command = "clear\n";
fwrite($FileHandle, $command);
$command = "add ". VIDEO_DIR ."/". $file ."\n";
}
else
{
$command = "enqueue ". VIDEO_DIR ."/". $file ."\n";
}
fwrite($FileHandle, $command);
$command= "logout\n";
fwrite($FileHandle, $command);
$test = shell_exec("netcat 127.0.2.6 $port < play_title");
shell_exec("netcat 127.0.2.6 20004 < play_title");
fclose($FileHandle);
unlink("play_title");
}