createFromXml() публичный статический Метод

Update the track properties using an xml element.
public static createFromXml ( duncan3dc\DomParser\XmlElement $xml, Controller $controller ) : static
$xml duncan3dc\DomParser\XmlElement The xml element representing the track meta data.
$controller Controller A controller instance on the playlist's network
Результат static
Пример #1
0
 /**
  * Get attributes about the currently active track in the queue.
  *
  * @return State Track data containing the following elements
  */
 public function getStateDetails()
 {
     $data = $this->soap("AVTransport", "GetPositionInfo");
     if (!$data["TrackMetaData"]) {
         return new State();
     }
     $parser = new XmlParser($data["TrackMetaData"]);
     $state = State::createFromXml($parser->getTag("item"), $this);
     if ((string) $parser->getTag("streamContent")) {
         $info = $this->getMediaInfo();
         if (!($state->stream = (string) (new XmlParser($info["CurrentURIMetaData"]))->getTag("title"))) {
             $state->stream = (string) $parser->getTag("title");
         }
     }
     $state->queueNumber = (int) $data["Track"];
     $state->duration = $data["TrackDuration"];
     $state->position = $data["RelTime"];
     # If we have a queue number, it'll be one-based, rather than zero-based, so convert it
     if ($state->queueNumber > 0) {
         $state->queueNumber--;
     }
     return $state;
 }