forked from jmnorma/MeTube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
media.php
64 lines (52 loc) · 1.44 KB
/
media.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
session_start();
include_once "include/functions.inc.php";
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<link rel="stylesheet" href="app.css" type="text/css">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Media</title>
<script src="Scripts/AC_ActiveX.js" type="text/javascript"></script>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<body class="App">
<?php
if(isset($_GET['id'])) {
$query = "SELECT * FROM Media WHERE media_id='".$_GET['id']."'";
$result = queryResults( $query );
$result_row = mysqli_fetch_assoc($result);
$filename=$result_row["title"];
$filepath=$result_row["file_ulr"];
$type=$result_row["duration"];
if($type == 0 ) //view image
{
echo "Viewing Picture:";
echo $result_row["title"];
echo "<img src='".$filepath."'/>";
}
else //view movie
{
?>
<p>Viewing Video:<?php echo $result_row["file_ulr"];?></p>
<?php
$video_location = $result_row['file_ulr'];
echo '<video width="320" height="240" controls autoplay muted>';
echo '<source src='.$video_location.' type="video/mp4">';
?>
Your browser does not support the video tag.
</video>
</object>
<?php
}
}
else
{
?>
<meta http-equiv="refresh" content="0;url=browse.php">
<?php
}
?>
</body>
</html>