/** * Inicia o video * * @name play * @return boolean */ public function play() { // Verifica se o video ja foi iniciado if ($this->video_state == -1) { // Verifica se existe arquivo if (!file_exists($this->render_file)) { return FALSE; } // Verifica se o caminho do render existe if (!file_exists($this->render_path)) { echo "Não foi possivle encontrar " . $this->render_path; return FALSE; } // Adiciona os ultimos parametros $options = array_merge($this->render_options, array("-slave", "-quiet", "-menu", "-wid", $this->socket->get_id(), escapeshellarg($this->render_file))); // Cria o pipe $this->pipe = Fabula::PipeIO($this->render_path, $options); // Cria o callback do stdout $this->pipe->set_callback("stdout", array($this, "stdout")); // Cria o callback do final do video $this->pipe->set_callback("hup", array($this, "io_hup")); // Inicia o video $this->pipe->run(); // Muda o estado do video $this->video_state = 1; // Adiciona o timeout $this->video_changed_timeout = Gtk::timeout_add(500, array($this, "video_changed")); // Retorna verdadeiro return TRUE; } else { // Retorna a falha return FALSE; } }