Final update for anyone who has a similar problem, It is now working version with original approach modified based on suggestions (should've probably read more carefully to avoid running around the solution:).
so index.html with <video> tags
....
<tr><td>
<video height="auto" width="200" controls >
<source src="play.php?play_video=101" type="video/mp4">
</video>
</td> <td>Lecture 101....</td>
</tr><tr><td>
<video height="auto" width="200" controls >
<source src="play.php?play_video=102" type="video/mp4">
</video>
</td> <td>Lecture 102....</td>
</tr>
....
and play.php return stream like originally to href link tag
<?php
include 'dblog.php';
if ( ($_SERVER['REQUEST_METHOD'] === "GET")
&& ( isset($_GET['play_video']) ) ) {
if ($_GET['play_video'] == "101") {
$file_path_name = "../../DVD/Lecture-101.mp4";
} elseif ($_GET['play_video'] == "102") {
$file_path_name = "../../DVD/Lecture-102.mp4";
}
$ctype= 'video/mp4';
header('Content-Type: ' . $ctype);
$handle = fopen($file_path_name, "rb");
$contents = fread($handle, filesize($file_path_name));
fclose($handle);
write_vid_log($_GET['play_video'], $DB, 'start');
echo $contents;
} else {
echo "alert(I'm Sorry wrong link)";
}
?>
So now works to be able to supply links outside of www root folder, and it plays video when client clicks. A few more challenges:
- links to media files are easy downloadable, even though path, and file name is not shown, so I need use PHP script to check user and his rights before streaming video file
- use CSS to resize and center video over the page, once clicked to play, and can be made seen as if it's playing in the lightbox. Looks like this is possible even without any JS
Any extra suggestions, would be appreciated
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…