當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Playlist::fromSimpleXMLElement方法代碼示例

本文整理匯總了PHP中Playlist::fromSimpleXMLElement方法的典型用法代碼示例。如果您正苦於以下問題:PHP Playlist::fromSimpleXMLElement方法的具體用法?PHP Playlist::fromSimpleXMLElement怎麽用?PHP Playlist::fromSimpleXMLElement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Playlist的用法示例。


在下文中一共展示了Playlist::fromSimpleXMLElement方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: fetch

 /** Fetch XSPF playlists using a last.fm playlist url.
  *
  * @param string  $playlist A lastfm protocol playlist url ('lastfm://playlist/...'). (Required)
  * @param string  $streaming  Weather to fetch a playlist for streaming. (Optional)
  * @param string  $fod    Weather to fetch a playlist with free on demand tracks. (Optional)
  * @param Session $session  A session obtained by {@link de.felixbruns.lastfm.Auth#getSession Auth::getSession} or {@link de.felixbruns.lastfm.Auth#getMobileSession Auth::getMobileSession}. (Optional)
  * @return  Playlist      A Playlist object.
  *
  * @static
  * @access  public
  * @throws  Error
  */
 public static function fetch($playlist, $streaming = null, $fod = null, $session = null)
 {
     if ($session == null) {
         $xml = CallerFactory::getDefaultCaller()->call('playlist.fetch', array_filter(array('playlistURL' => $playlist, 'streaming' => $streaming, 'fod' => $fod)));
     } else {
         $xml = CallerFactory::getDefaultCaller()->call('playlist.fetch', array_filter(array('playlistURL' => $playlist, 'streaming' => $streaming, 'fod' => $fod, 'sk' => $session->getKey())));
     }
     return Playlist::fromSimpleXMLElement($xml);
 }
開發者ID:niczak,項目名稱:php-last.fm-api,代碼行數:21,代碼來源:Playlist.php

示例2: getPlaylists

 /** Get a list of a user's playlists on last.fm.
  *
  * @param	string	$user	The last.fm username to fetch the playlists of. (Required)
  * @return	array			An array of Playlist objects.
  *
  * @static
  * @access	public
  * @throws	Error
  */
 public static function getPlaylists($user)
 {
     $xml = CallerFactory::getDefaultCaller()->call('user.getPlaylists', array('user' => $user));
     $playlists = array();
     foreach ($xml->children() as $playlist) {
         $playlists[] = Playlist::fromSimpleXMLElement($playlist);
     }
     return $playlists;
 }
開發者ID:niczak,項目名稱:php-last.fm-api,代碼行數:18,代碼來源:User.php

示例3: getPlaylists

 /**
  * Get a list of a radio's playlists on last.fm.
  * 
  * @param string $session sk (Required) : A session key generated by authenticating a user via the authentication protocol. 
  * @param float $speed_multiplier speed_multiplier (Optional) : The rate at which to provide the stream (supported multipliers are 1.0 and 2.0) 
  * @param int $bitrate bitrate (Optional) : What bitrate to stream content at, in kbps (supported bitrates are 64 and 128)
  * @param bool $discovery discovery (Optional) : Whether to request last.fm content with discovery mode switched on.
  * @param bool $rtp rtp (Optional) : Whether the user is scrobbling or not during this radio session (helps content generation)
  * 
  * @static
  * @access  public
  * @throws  Error
  * 
  * @return Playlist
  *
  */
 public static function getPlaylists(Session $session, $speed_multiplier = null, $bitrate = null, $discovery = null, $rtp = null)
 {
     $xml = CallerFactory::getDefaultCaller()->signedCall('radio.getPlaylist', array('discovery' => $discovery, 'rtp' => $rtp, 'speed_multiplier' => $speed_multiplier, 'bitrate' => $bitrate), $session);
     return Playlist::fromSimpleXMLElement($xml);
 }
開發者ID:niczak,項目名稱:php-last.fm-api,代碼行數:21,代碼來源:Radio.php


注:本文中的Playlist::fromSimpleXMLElement方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。