Translation update done using Pootle.
[phpmyadmin/crack.git] / bs_play_media.php
blobad3c9af51950ad069c015865dede1fb33e76e33e
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * @package BLOBStreaming
5 */
7 /**
8 * Core library.
9 */
10 require_once './libraries/common.inc.php';
13 * @var string contains media type of BLOB reference
15 $mediaType = isset($_REQUEST['media_type']) ? $_REQUEST['media_type'] : NULL;
18 * @var string indicates whether media type is of custom type
20 $customType = isset($_REQUEST['custom_type']) ? $_REQUEST['custom_type'] : false;
23 * @var string contains BLOB reference
25 $bsReference = isset($_REQUEST['bs_reference']) ? $_REQUEST['bs_reference'] : NULL;
27 // if media type and BS reference are specified
28 if (isset($mediaType) && isset($bsReference))
30 // load PMA configuration
31 $PMA_Config = $GLOBALS['PMA_Config'];
33 // if PMA configuration exists
34 if (!empty($PMA_Config))
36 // retrieve BS server variables from PMA configuration
37 $bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
38 if (empty($bs_server)) die('No blob streaming server configured!');
40 $bs_file_path = "http://" . $bs_server . '/' . $bsReference;
42 if (isset($customType) && $customType)
44 $bs_file_path = 'bs_disp_as_mime_type.php' . PMA_generate_common_url(array('reference' => $bsReference, 'c_type' => $mediaType));
47 <html>
48 <head>
49 </head>
50 <body>
51 <?php
53 // supported media types
54 switch ($mediaType)
56 // audio content
57 case 'audio/mpeg':
58 ?><embed width=620 height=100 src="<?php echo htmlspecialchars($bs_file_path); ?>" autostart=true></embed><?php
59 break;
60 // video content
61 case 'application/x-flash-video':
62 case 'video/mpeg':
63 ?><embed width=620 height=460 src="<?php echo htmlspecialchars($bs_file_path); ?>" autostart=true></embed><?php
64 break;
65 default:
66 // do nothing
69 </body>
70 </html>
71 <?php
72 } // end if (!empty($PMA_Config))
73 } // end if (isset($mediaType) && isset($bsReference))