French update
[phpmyadmin/last10db.git] / bs_play_media.php
blob806437b0098b5bd378ad7fef71af2eaf1098d1c8
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * @author Raj Kissu Rajandran
5 * @version 1.0
6 * @package BLOBStreaming
7 */
9 /**
10 * Core library.
12 require_once './libraries/common.inc.php';
15 * @var string contains media type of BLOB reference
17 $mediaType = isset($_REQUEST['media_type']) ? $_REQUEST['media_type'] : NULL;
20 * @var string indicates whether media type is of custom type
22 $customType = isset($_REQUEST['custom_type']) ? $_REQUEST['custom_type'] : false;
25 * @var string contains BLOB reference
27 $bsReference = isset($_REQUEST['bs_reference']) ? $_REQUEST['bs_reference'] : NULL;
29 // if media type and BS reference are specified
30 if (isset($mediaType) && isset($bsReference))
32 // load PMA configuration
33 $PMA_Config = $_SESSION['PMA_Config'];
35 // if PMA configuration exists
36 if (!empty($PMA_Config))
38 // retrieve BS server variables from PMA configuration
39 $bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
40 if (empty($bs_server)) die('No blob streaming server configured!');
42 $bs_file_path = "http://" . $bs_server . '/' . $bsReference;
44 if (isset($customType) && $customType)
46 $bs_file_path = 'bs_disp_as_mime_type.php' . PMA_generate_common_url(array('reference' => $bsReference, 'c_type' => $mediaType));
49 <html>
50 <head>
51 </head>
52 <body>
53 <?php
55 // supported media types
56 switch ($mediaType)
58 // audio content
59 case 'audio/mpeg':
60 ?><embed width=620 height=100 src="<?php echo htmlspecialchars($bs_file_path); ?>" autostart=true></embed><?php
61 break;
62 // video content
63 case 'application/x-flash-video':
64 case 'video/mpeg':
65 ?><embed width=620 height=460 src="<?php echo htmlspecialchars($bs_file_path); ?>" autostart=true></embed><?php
66 break;
67 default:
68 // do nothing
71 </body>
72 </html>
73 <?php
74 } // end if (!empty($PMA_Config))
75 } // end if (isset($mediaType) && isset($bsReference))