Cleanup of po files.
[phpmyadmin/dkf.git] / bs_play_media.php
blob94ed25a2b26a10240b4224a4b95ac461f10505b1
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * @version 1.0
5 * @package BLOBStreaming
6 */
8 /**
9 * Core library.
11 require_once './libraries/common.inc.php';
14 * @var string contains media type of BLOB reference
16 $mediaType = isset($_REQUEST['media_type']) ? $_REQUEST['media_type'] : NULL;
19 * @var string indicates whether media type is of custom type
21 $customType = isset($_REQUEST['custom_type']) ? $_REQUEST['custom_type'] : false;
24 * @var string contains BLOB reference
26 $bsReference = isset($_REQUEST['bs_reference']) ? $_REQUEST['bs_reference'] : NULL;
28 // if media type and BS reference are specified
29 if (isset($mediaType) && isset($bsReference))
31 // load PMA configuration
32 $PMA_Config = $GLOBALS['PMA_Config'];
34 // if PMA configuration exists
35 if (!empty($PMA_Config))
37 // retrieve BS server variables from PMA configuration
38 $bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
39 if (empty($bs_server)) die('No blob streaming server configured!');
41 $bs_file_path = "http://" . $bs_server . '/' . $bsReference;
43 if (isset($customType) && $customType)
45 $bs_file_path = 'bs_disp_as_mime_type.php' . PMA_generate_common_url(array('reference' => $bsReference, 'c_type' => $mediaType));
48 <html>
49 <head>
50 </head>
51 <body>
52 <?php
54 // supported media types
55 switch ($mediaType)
57 // audio content
58 case 'audio/mpeg':
59 ?><embed width=620 height=100 src="<?php echo htmlspecialchars($bs_file_path); ?>" autostart=true></embed><?php
60 break;
61 // video content
62 case 'application/x-flash-video':
63 case 'video/mpeg':
64 ?><embed width=620 height=460 src="<?php echo htmlspecialchars($bs_file_path); ?>" autostart=true></embed><?php
65 break;
66 default:
67 // do nothing
70 </body>
71 </html>
72 <?php
73 } // end if (!empty($PMA_Config))
74 } // end if (isset($mediaType) && isset($bsReference))