#author("2024-01-10T07:58:50+00:00","","")
#author("2024-01-10T08:00:28+00:00","","")
#navi(../)
** nicovideo_player.inc.php [#a38f9eea]
|RIGHT:125|LEFT:360|c
|~サマリ|ニコニコ動画の動画再生プラグイン|
|~リビジョン|1.0|
|~対応バージョン|1.5.3|
|~投稿者|[[K]]|
|~投稿日|&new{2020-08-08 (土) 21:49:00};|
**目次 [#a634b481]
#contents
**概要 [#c53d518b]
ニコニコ動画を埋め込むことができるプラグイン
**使い方 [#l41d0d67]
***フォーマット [#nb459ac5]
 #nicovideo_player(動画ID,[横],[高さ])
***例 [#p2fb002c]
 #nicovideo_player(sm234ABCD,640,360)
**導入 [#ma1968ab]
「plugin/nicovideo_player.inc.php」にソースコードを保存するかダウンロードします。
***ダウンロード [#c8f6a221]
http://pkom.ml/file/download.php?f=nicovideo_player.inc.php
***ソース [#k7d993ba]
 <?php
 function plugin_nicovideo_player_convert()
 {
     if (func_num_args() < 1) return "使い方:#nicovideo_player([VideoID(sm~~~~~~~~)],[横],[高さ])";
     $args = func_get_args();
     $id = trim($args[0]);
     $width = trim($args[1])."px";
     $height = trim($args[2])."px";
     $width_2 = trim($args[1]);
     $height_2 = trim($args[2]);
     if ($width_2 == null) $width_2 = "640";
     if ($height_2 == null) $height_2 = "360";
     if ($width == "px") $width = "100%";
     if ($height == "px") $height = "0";
     $str = <<<EOD
     <div style="width: 100%; max-width: 560px;">
         <div style="position: relative; padding-bottom: 56.25%; height: $height; width: $width;">
             <script type="application/javascript" src="https&#58;//embed.nicovideo.jp/watch/$id/script?w=$width_2&h=$height_2"></script><noscript><p>JavaScriptが無効です。</p><a href="https&#58;//www.nicovideo.jp/watch/$id">https&#58;//www.nicovideo.jp/watch/$id</a></noscript>
         </div>
     </div>
     <br><br><br>
     EOD;
     return $str;
 }
 function plugin_nicovideo_player_inline() {
     $args = func_get_args();
 	return call_user_func_array('plugin_nicovideo_player_convert', $args);
 }
 ?>
**コメント [#m1a50c0f]
- 下に謎の余白が出来るので修正しました。 -- [[なつ]] &new{2024-01-10 (水) 16:58:50};
- 下に謎の余白が出来るので修正しました。 -- [[なつ]] &new{2024-01-10 (水) 17:00:28};

#comment

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Site admin: PukiWiki Development Team

PukiWiki 1.5.4+ © 2001-2022 PukiWiki Development Team. Powered by PHP 8.2.12. HTML convert time: 0.100 sec.

SourceForge