コード例 #1
0
ファイル: player.php プロジェクト: GoPlaceIn/siacc
function Main()
{
    header('Content-Type: text/html; charset=iso-8859-1');
    $session = $_SESSION['casores'] ? $_SESSION['casores'] : $_SESSION['caso'];
    //if (((isset($_SESSION['casores'])) && ($_SESSION['casores'] > 0)) || ((isset($_SESSION['caso'])) && ($_SESSION['caso'] > 0)))
    if ($session) {
        $midia = $_POST['midia'];
        $clsmid = new Midia();
        //$clsmid->setCodCaso($_SESSION['casores']);
        $clsmid->setCodCaso($session);
        $clsmid->setCodMidia(base64_decode($midia));
        if ($clsmid->CarregaPorCodigoEspecifico()) {
            if ($clsmid->getTipoMidia() == Comuns::TIPO_MIDIA_VIDEO) {
                $vidplayer = new VideoPlayer($clsmid->getURL(), !is_null($clsmid->getLargura()) ? $clsmid->getLargura() : 320, !is_null($clsmid->getAltura()) ? $clsmid->getAltura() : 290, 'false', 'true');
                if ($vidplayer) {
                    $html = '<player>' . ($vidplayer->player() != "" ? $vidplayer->player() : $vidplayer->getLastError()) . '</player>';
                    $html .= '<descricao>' . (is_null($clsmid->getDescricao()) ? '' : $clsmid->getDescricao()) . '</descricao>';
                    $html .= '<complemento>' . (is_null($clsmid->getComplemento()) ? '' : $clsmid->getComplemento()) . '</complemento>';
                    $html .= '<btnfechar><a href="javascript:void(0);" onclick="jQuery(\'#view-midia\').html(\'\');" class="btnFecharMidia">@lng[Fechar]</a></btnfechar>';
                } else {
                    $html = "ERRO";
                }
            } else {
                if ($clsmid->getTipoMidia() == Comuns::TIPO_MIDIA_AUDIO) {
                    $audplayer = new AudioPlayer($clsmid->getURL(), 'false', 'true');
                    if ($audplayer) {
                        $html = '<player>' . $audplayer->player() . '</player>';
                        $html .= '<descricao>' . (is_null($clsmid->getDescricao()) ? '' : $clsmid->getDescricao()) . '</descricao>';
                        $html .= '<complemento>' . (is_null($clsmid->getComplemento()) ? '' : $clsmid->getComplemento()) . '</complemento>';
                        $html .= '<btnfechar><a href="javascript:void(0);" onclick="fntFechaMidia();" class="btnFecharMidia">@lng[Fechar]</a></btnfechar>';
                    } else {
                        $html = "ERRO";
                    }
                } else {
                    if ($clsmid->getTipoMidia() == Comuns::TIPO_MIDIA_IMAGEM) {
                        $html = '<player><img src="viewimagem.php?img=' . base64_encode($clsmid->getCodMidia()) . '&ex=f" alt="' . $clsmid->getDescricao() . '" title="' . $clsmid->getDescricao() . '" /></player>';
                        $html .= '<descricao>' . (is_null($clsmid->getDescricao()) ? '' : $clsmid->getDescricao()) . '</descricao>';
                        $html .= '<complemento>' . (is_null($clsmid->getComplemento()) ? '' : $clsmid->getComplemento()) . '</complemento>';
                    }
                }
            }
        }
        echo $html;
    } else {
        echo "ERRO. @lng[Seção não definida]";
    }
}
コード例 #2
0
ファイル: VideoPlayer.php プロジェクト: nassos9090/plugin
 function LC_ProductsDetail($objPage)
 {
     /* youtubeのURLリンク */
     $objPage->youtube_url = 'http://www.youtube.com/embed/';
     /* niconicoのURLリンク */
     $objPage->nico_url = 'http://ext.nicovideo.jp/thumb_watch/';
     /* 動画判別用 */
     $objPage->arrVideo = VideoPlayer::lfGetURL($objPage);
     // 動画プレイヤー設定情報取得
     $objPage->arrVideoData = VideoPlayer::lfGetVideoPlayer($objPage);
     if ($objPage->arrVideo['disp_width'] == 0 && $objPage->arrVideo['disp_height'] == 0) {
         $objPage->arrVideo['disp_width'] = 480;
         $objPage->arrVideo['disp_height'] = 300;
     }
     /* アスペクト比の計算 */
     if ($objPage->arrVideo['disp_width'] <= 50) {
         $objPage->arrVideo['disp_width'] = $objPage->arrVideo['disp_height'] / 9 * 16;
     }
     if ($objPage->arrVideo['disp_height'] <= 50) {
         $objPage->arrVideo['disp_height'] = $objPage->arrVideo['disp_width'] / 16 * 9;
     }
     $objPage->arrVideo['youtube_id'] = $objPage->arrVideoData->youtube_id;
     $objPage->arrVideo['view_id'] = $objPage->arrVideoData->view_id;
     $objPage->arrVideo['niconico_id'] = $objPage->arrVideoData->niconico_id;
 }
コード例 #3
0
ファイル: resolucao.class.php プロジェクト: GoPlaceIn/siacc
 private function BuscaDadosSaibaMais($chaveAtual)
 {
     $sql = "select mescasomontagemanexos.TipoConteudo, mescasomontagemanexos.CodConteudo ";
     $sql .= "\t, mesmidia.Descricao as DescricaoMidia, mesmidia.Complemento as ComplementoMidia, mesmidia.url as UrlMidia, mesmidia.CodTipo as CodTipoMidia ";
     $sql .= "\t, mescasoconteudo.Descricao as DescricaoConteudo, mescasoconteudo.Texto as TextoConteudo, mescasoconteudo.Tipo as CodTipoConteudo ";
     $sql .= "from mescasomontagemanexos ";
     $sql .= "left outer join mesmidia ";
     $sql .= " \tON mesmidia.CodCaso = mescasomontagemanexos.CodCaso ";
     $sql .= " \tAND mesmidia.CodMidia = mescasomontagemanexos.CodConteudo ";
     $sql .= "left outer join mescasoconteudo ";
     $sql .= " \tON mescasoconteudo.CodCaso = mescasomontagemanexos.CodCaso ";
     $sql .= " \tAND mescasoconteudo.CodConteudo = mescasomontagemanexos.CodConteudo ";
     $sql .= "where CodChave = :pCodChave ";
     $cnn = Conexao2::getInstance();
     $cmd = $cnn->prepare($sql);
     $cmd->bindParam(":pCodChave", $chaveAtual, PDO::PARAM_STR);
     $cmd->execute();
     if ($cmd->errorCode() == Comuns::QUERY_OK) {
         if ($cmd->rowCount() > 0) {
             $html = '';
             while ($item = $cmd->fetch(PDO::FETCH_OBJ)) {
                 if (strtoupper($item->TipoConteudo) == "C") {
                     $html .= '<strong>' . $item->DescricaoConteudo . '</strong>';
                     $html .= '<br />' . $item->TextoConteudo;
                 } else {
                     if ($item->CodTipoMidia == Comuns::TIPO_MIDIA_VIDEO) {
                         $vidplayer = new VideoPlayer($item->UrlMidia, 320, 290, 'false', 'true');
                         if ($vidplayer) {
                             $html .= '<strong>' . $item->DescricaoMidia . '</strong>';
                             $html .= '<p>' . $item->ComplementoMidia . '</p>';
                             $html .= '<br />' . $vidplayer->player();
                         } else {
                             $html = "@lng[ERRO ao gerar vídeo]";
                         }
                     } else {
                         if ($item->CodTipoMidia == Comuns::TIPO_MIDIA_AUDIO) {
                             $audplayer = new AudioPlayer($item->UrlMidia, 'false', 'true');
                             if ($audplayer) {
                                 $html .= '<strong>' . $item->DescricaoMidia . '</strong>';
                                 $html .= '<p>' . $item->ComplementoMidia . '</p>';
                                 $html .= '<br />' . $audplayer->player();
                             } else {
                                 $html = "ERRO";
                             }
                         } else {
                             if ($item->CodTipoMidia == Comuns::TIPO_MIDIA_IMAGEM) {
                                 $html .= '<strong>' . $item->DescricaoMidia . '</strong>';
                                 $html .= '<p>' . $item->ComplementoMidia . '</p>';
                                 $html .= '<br /><img src="viewimagem.php?img=' . base64_encode($item->CodConteudo) . '&ex=f" alt="' . $item->DescricaoMidia . '" title="' . $item->DescricaoMidia . '" /></player>';
                             } else {
                                 $html .= '<strong>' . $item->DescricaoMidia . '</strong>';
                                 $html .= '<p>' . $item->ComplementoMidia . '</p>';
                                 $html .= '<a href="' . $item->UrlMidia . '">Download</a>';
                             }
                         }
                     }
                 }
             }
         }
         return $html;
     } else {
         $msg = $cmd->errorInfo();
         $this->msg_erro = $msg[2];
         //return false;
         return $this->msg_erro;
     }
 }
コード例 #4
0
 /**
  * function getMediaLink
  *
  * @param  $media_data -
  * @return string      - the html string containing the appropriate link for the given media
  */
 public function getMediaLink($media_data = array())
 {
     $media_type = $media_data[1];
     if (isset($media_data['type'])) {
         $media_type = $media_data['type'];
     }
     $media_value = $media_data[2];
     if (isset($media_data['value'])) {
         $media_value = $media_data['value'];
     }
     $media_real_file_name = $media_data[3];
     $path_to_media = $media_data[4];
     $media_title = isset($media_data[5]) ? $media_data[5] : null;
     if (isset($media_data['title'])) {
         $media_title = $media_data['title'];
     }
     if ($media_type === _IMAGE || $media_type === _MONTESSORI) {
         $viewing_prefs = isset($this->viewing_preferences[_IMAGE]) ? $this->viewing_preferences[_IMAGE] : null;
         return ImageViewer::link($this->media_path, $media_value, $media_real_file_name, $path_to_media, $viewing_prefs, $media_title, $media_type);
     } else {
         if ($media_type === _SOUND || $media_type === _PRONOUNCE) {
             $viewing_prefs = isset($this->viewing_preferences[_SOUND]) ? $this->viewing_preferences[_SOUND] : null;
             return AudioPlayer::link($this->media_path, $media_value, $media_real_file_name, $path_to_media, $viewing_prefs, $media_title, $media_type);
         } else {
             if ($media_type === _VIDEO || $media_type === _LABIALE || $media_type === _LIS || $media_type === _FINGER_SPELLING) {
                 $viewing_prefs = isset($this->viewing_preferences[_VIDEO]) ? $this->viewing_preferences[_VIDEO] : null;
                 return VideoPlayer::link($this->media_path, $media_value, $media_real_file_name, $path_to_media, $viewing_prefs, $media_title, $media_type);
             } else {
                 if ($media_type === _DOC) {
                     $viewing_prefs = isset($this->viewing_preferences[_DOC]) ? $this->viewing_preferences[_DOC] : null;
                     return DocumentViewer::link($this->media_path, $media_value, $media_real_file_name, $path_to_media, $viewing_prefs, $media_title);
                 } else {
                     if ($media_type === _LINK) {
                         $viewing_prefs = isset($this->viewing_preferences[_LINK]) ? $this->viewing_preferences[_LINK] : null;
                         return ExternalLinkViewer::view($this->media_path, $media_value, $viewing_prefs);
                     } else {
                         return '';
                     }
                 }
             }
         }
     }
 }