Webstream support added.
This commit is contained in:
parent
108a6a154b
commit
fe15dbd069
|
@ -166,7 +166,7 @@ $tpldata['showMenu']=true;
|
||||||
</td><td valign="top">
|
</td><td valign="top">
|
||||||
<i><?php echo($o['gunid'] ? "({$o['gunid']})" : '' )?></i>
|
<i><?php echo($o['gunid'] ? "({$o['gunid']})" : '' )?></i>
|
||||||
</td><td>
|
</td><td>
|
||||||
<?php $a=array('Folder'=>'D', 'File'=>'F', 'Replica'=>'R', 'audioclip'=>'A', 'playlist'=>'P'); echo$a[$o['type']]?>
|
<?php $a=array('Folder'=>'D', 'File'=>'F', 'Replica'=>'R', 'audioclip'=>'A', 'playlist'=>'P', 'webstream'=>'S'); echo$a[$o['type']]?>
|
||||||
<a href="javascript:frename('<?php echo$o['name']?>', '<?php echo$o['id']?>')" class="button">rename</a>
|
<a href="javascript:frename('<?php echo$o['name']?>', '<?php echo$o['id']?>')" class="button">rename</a>
|
||||||
<?php if($o['type']!='Folder'){?>
|
<?php if($o['type']!='Folder'){?>
|
||||||
<a href="javascript:fmove('<?php echo$o['id']?>', '')" class="button">move</a>
|
<a href="javascript:fmove('<?php echo$o['id']?>', '')" class="button">move</a>
|
||||||
|
@ -184,6 +184,11 @@ $tpldata['showMenu']=true;
|
||||||
<a href="gbHttp.php?act=getMdata&id=<?php echo$o['id']?>" class="button">MetaData</a>
|
<a href="gbHttp.php?act=getMdata&id=<?php echo$o['id']?>" class="button">MetaData</a>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
<?php if($o['type']=='playlist'){?>
|
<?php if($o['type']=='playlist'){?>
|
||||||
|
<a href="../xmlrpc/simpleGet.php?sessid=<?php echo$sessid?>&id=<?php echo$o['gunid']?>" class="button">simpleGet</a>
|
||||||
|
<a href="gbHttp.php?act=getMdata&id=<?php echo$o['id']?>" class="button">MetaData</a>
|
||||||
|
<?php }?>
|
||||||
|
<?php if($o['type']=='webstream'){?>
|
||||||
|
<a href="../xmlrpc/simpleGet.php?sessid=<?php echo$sessid?>&id=<?php echo$o['gunid']?>" class="button">simpleGet</a>
|
||||||
<a href="gbHttp.php?act=getMdata&id=<?php echo$o['id']?>" class="button">MetaData</a>
|
<a href="gbHttp.php?act=getMdata&id=<?php echo$o['id']?>" class="button">MetaData</a>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
<?php if($o['type']=='Replica'){?>
|
<?php if($o['type']=='Replica'){?>
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.13 $
|
Version : $Revision: 1.14 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/XR_LocStor.php,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/XR_LocStor.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -276,6 +276,57 @@ class XR_LocStor extends LocStor{
|
||||||
return new XML_RPC_Response(XML_RPC_encode(array('gunid'=>$res)));
|
return new XML_RPC_Response(XML_RPC_encode(array('gunid'=>$res)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store audio stream identified by URL - no raw audio data
|
||||||
|
*
|
||||||
|
* The XML-RPC name of this method is "locstor.storeWebstream".
|
||||||
|
*
|
||||||
|
* The input parameters are an XML-RPC struct with the following
|
||||||
|
* fields:
|
||||||
|
* <ul>
|
||||||
|
* <li> sessid : string - session id </li>
|
||||||
|
* <li> gunid : string - global unique id of AudioCLip</li>
|
||||||
|
* <li> metadata : string - metadata XML string</li>
|
||||||
|
* <li> fname : string - human readable mnemonic file name
|
||||||
|
* with extension corresponding to filetype</li>
|
||||||
|
* <li> url : string - URL of the webstrea,</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* On success, returns a XML-RPC struct with single field:
|
||||||
|
* <ul>
|
||||||
|
* <li> gunid : string - gunid of stored file</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* On errors, returns an XML-RPC error response.
|
||||||
|
* The possible error codes and error message are:
|
||||||
|
* <ul>
|
||||||
|
* <li> 3 - Incorrect parameters passed to method:
|
||||||
|
* Wanted ... , got ... at param </li>
|
||||||
|
* <li> 801 - wrong 1st parameter, struct expected.</li>
|
||||||
|
* <li> 805 - xr_storeWebstream:
|
||||||
|
* <message from lower layer> </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
* @return XMLRPC struct
|
||||||
|
* @see LocStor::storeWebstream
|
||||||
|
*/
|
||||||
|
function xr_storeWebstream($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->storeWebstream(
|
||||||
|
$r['sessid'], $r['gunid'], $r['metadata'], $r['fname'], $r['url']
|
||||||
|
);
|
||||||
|
if(PEAR::isError($res)){
|
||||||
|
return new XML_RPC_Response(0, 805,
|
||||||
|
"xr_storeWebstream: ".$res->getMessage().
|
||||||
|
" ".$res->getUserInfo()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return new XML_RPC_Response(XML_RPC_encode(array('gunid'=>$res)));
|
||||||
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------ access raw audio data */
|
/* ------------------------------------------------ access raw audio data */
|
||||||
/**
|
/**
|
||||||
* Make access to audio clip.
|
* Make access to audio clip.
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.8 $
|
Version : $Revision: 1.9 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/simpleGet.php,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/simpleGet.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -97,15 +97,34 @@ if(PEAR::isError($ex_pl)){
|
||||||
if(!$ex_ac && !$ex_pl){ http_error(404, "404 File not found"); }
|
if(!$ex_ac && !$ex_pl){ http_error(404, "404 File not found"); }
|
||||||
$ac =& StoredFile::recallByGunid($locStor, $gunid);
|
$ac =& StoredFile::recallByGunid($locStor, $gunid);
|
||||||
if(PEAR::isError($ac)){ http_error(500, $ac->getMessage()); }
|
if(PEAR::isError($ac)){ http_error(500, $ac->getMessage()); }
|
||||||
|
$ftype = $locStor->getObjType($id = $locStor->_idFromGunid($gunid));
|
||||||
|
if(PEAR::isError($ftype)){ http_error(500, $ftype->getMessage()); }
|
||||||
if($ex_ac){
|
if($ex_ac){
|
||||||
$realFname = $ac->_getRealRADFname();
|
switch($ftype){
|
||||||
$mime = $ac->rmd->getMime();
|
case"audioclip":
|
||||||
header("Content-type: $mime");
|
$realFname = $ac->_getRealRADFname();
|
||||||
readfile($realFname);
|
$mime = $ac->rmd->getMime();
|
||||||
|
header("Content-type: $mime");
|
||||||
|
readfile($realFname);
|
||||||
|
break;
|
||||||
|
case"webstream":
|
||||||
|
$url = $locStor->bsGetMetadataValue($id, 'ls:url');
|
||||||
|
if(PEAR::isError($url)){ http_error(500, $url->getMessage()); }
|
||||||
|
$url = $url[0]['value'];
|
||||||
|
$txt = "Location: $url";
|
||||||
|
header($txt);
|
||||||
|
// echo "$txt\n";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
var_dump($ftype);
|
||||||
|
http_error(500, "500 Unknown ftype ($ftype)");
|
||||||
|
}
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
if($ex_pl){
|
if($ex_pl){
|
||||||
$md = $locStor->getMdata($ac->getId(), $sessid);
|
// $md = $locStor->bsGetMetadata($ac->getId(), $sessid);
|
||||||
|
$md = $locStor->getAudioClip($sessid, $gunid);
|
||||||
|
// header("Content-type: text/xml");
|
||||||
header("Content-type: application/smil");
|
header("Content-type: application/smil");
|
||||||
echo $md;
|
echo $md;
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Author : $Author: tomas $
|
# Author : $Author: tomas $
|
||||||
# Version : $Revision: 1.20 $
|
# Version : $Revision: 1.21 $
|
||||||
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/testRunner.sh,v $
|
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/testRunner.sh,v $
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -176,6 +176,14 @@ browseCategory() {
|
||||||
echo $RES
|
echo $RES
|
||||||
}
|
}
|
||||||
|
|
||||||
|
storeWebstream() {
|
||||||
|
URL="http://localhost/x"
|
||||||
|
echo -n "# storeWebstream: "
|
||||||
|
RGUNID=`$XR_CLI storeWebstream "$SESSID" '' "$METADATA" "new stream" "$URL"` || \
|
||||||
|
{ ERN=$?; echo $RGUNID; exit $ERN; }
|
||||||
|
echo $RGUNID
|
||||||
|
}
|
||||||
|
|
||||||
PLID="123456789abcdef8"
|
PLID="123456789abcdef8"
|
||||||
|
|
||||||
createPlaylist() {
|
createPlaylist() {
|
||||||
|
@ -342,6 +350,19 @@ playlistTest(){
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
webstreamTest(){
|
||||||
|
echo "#XMLRPC webstream test"
|
||||||
|
login
|
||||||
|
storeWebstream; GUNID=$RGUNID
|
||||||
|
# GUNID="4e58a66cf6e9f539"
|
||||||
|
# downloadMeta
|
||||||
|
getAudioClip
|
||||||
|
deleteAudioClip
|
||||||
|
logout
|
||||||
|
echo "#XMLRPC: webstream: OK."
|
||||||
|
echo ""
|
||||||
|
}
|
||||||
|
|
||||||
storageTest(){
|
storageTest(){
|
||||||
echo "#XMLRPC: storage test"
|
echo "#XMLRPC: storage test"
|
||||||
login
|
login
|
||||||
|
@ -400,6 +421,8 @@ elif [ "$COMM" == "preferences" ]; then
|
||||||
preferenceTest
|
preferenceTest
|
||||||
elif [ "$COMM" == "playlists" ]; then
|
elif [ "$COMM" == "playlists" ]; then
|
||||||
playlistTest
|
playlistTest
|
||||||
|
elif [ "$COMM" == "webstream" ]; then
|
||||||
|
webstreamTest
|
||||||
elif [ "$COMM" == "storage" ]; then
|
elif [ "$COMM" == "storage" ]; then
|
||||||
storageTest
|
storageTest
|
||||||
elif [ "x$COMM" == "x" ]; then
|
elif [ "x$COMM" == "x" ]; then
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.21 $
|
Version : $Revision: 1.22 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -105,6 +105,8 @@ $methods = array(
|
||||||
'releaseRawAudioData' => 'Release access to raw audio data.',
|
'releaseRawAudioData' => 'Release access to raw audio data.',
|
||||||
'getAudioClip' => 'Return the contents of an Audio clip.',
|
'getAudioClip' => 'Return the contents of an Audio clip.',
|
||||||
'resetStorage' => 'Reset storageServer for debugging.',
|
'resetStorage' => 'Reset storageServer for debugging.',
|
||||||
|
'storeWebstream' => 'Store audio stream identified by URL',
|
||||||
|
|
||||||
'createPlaylist' => 'Create a new Playlist metafile.',
|
'createPlaylist' => 'Create a new Playlist metafile.',
|
||||||
'editPlaylist' => 'Open a Playlist metafile for editing.',
|
'editPlaylist' => 'Open a Playlist metafile for editing.',
|
||||||
'savePlaylist' => 'Save a Playlist metafile.',
|
'savePlaylist' => 'Save a Playlist metafile.',
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.5 $
|
Version : $Revision: 1.6 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/xr_cli_test.php,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/xr_cli_test.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -104,6 +104,10 @@ $infos = array(
|
||||||
"searchMetadata" => array('m'=>"locstor.searchMetadata", 'p'=>NULL),
|
"searchMetadata" => array('m'=>"locstor.searchMetadata", 'p'=>NULL),
|
||||||
"browseCategory" => array('m'=>"locstor.browseCategory", 'p'=>NULL),
|
"browseCategory" => array('m'=>"locstor.browseCategory", 'p'=>NULL),
|
||||||
"resetStorage" => array('m'=>"locstor.resetStorage", 'p'=>array()),
|
"resetStorage" => array('m'=>"locstor.resetStorage", 'p'=>array()),
|
||||||
|
"storeWebstream" => array('m'=>"locstor.storeWebstream",
|
||||||
|
'p'=>array('sessid', 'gunid', 'metadata', 'fname', 'url'),
|
||||||
|
'r'=>array('gunid')
|
||||||
|
),
|
||||||
|
|
||||||
"createPlaylist" => array('m'=>"locstor.createPlaylist",
|
"createPlaylist" => array('m'=>"locstor.createPlaylist",
|
||||||
'p'=>array('sessid', 'plid', 'fname'), 'r'=>'plid'),
|
'p'=>array('sessid', 'plid', 'fname'), 'r'=>'plid'),
|
||||||
|
|
Loading…
Reference in New Issue