現在、sitecore CMS ツールを使用しており、fancybox を使用して動画を再生しています。現在、ユーザーは OGV および MP4 ビデオをアップロードして、プレーヤーにポップアップ表示されます。OGV または MP4 ビデオがない場合は、代わりに YouTube ビデオを埋め込むオプションを提供しようとしています。
ビデオ アイテムは、OGV、MP4、およびビデオ サムネイルを添付できるユーザーによって作成された ItemID によって渡されます。
私は多くのことを試しましたが、それを機能させることができません。
最初に、Sitecore CMS で YouTube ビデオ アドレス用のシングルテキスト フィールドを作成しました。
次に、VideoPlayer.ASPX.CS と VideoPlayer.ASPX に次のコード行を追加しようとしましたが、うまくいきませんでした: VideoYouTube = "http://" + Request.Url.Host + SitecoreUtility.GetVideoMediaUrl(videoItem 、「ビデオYoutube」)
これを機能させるために、何か助けが得られるかどうか疑問に思っていました。VideoPlayer.ASPX.CS の場合、これまでに動作しているコードは次のとおりです。
public partial class videoPlayer : System.Web.UI.Page
{
public string VideoImage { get; set; }
public string VideoMp4 { get; set; }
public string VideoOgv { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
string itemID = WebUtil.GetQueryString("itemID", "");
if (!string.IsNullOrEmpty(itemID))
{
Item videoItem = SitecoreUtility.Db.GetItem(new ID(new Guid(itemID)));
VideoImage = "http://" + Request.Url.Host + SitecoreUtility.GetMediaUrl(videoItem, "VideoImage");
VideoMp4 = "http://" + Request.Url.Host + SitecoreUtility.GetVideoMediaUrl(videoItem, "Video_MP4");
VideoOgv = "http://" + Request.Url.Host + SitecoreUtility.GetVideoMediaUrl(videoItem, "Video_OGV");
}
}
}
VideoPlayer.ASPX ファイルの場合、これまでに使用した作業コードは次のとおりです。
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Video Player</title>
<!--[if !IE]><!-->
<link href="/css/video_popup.css" rel="stylesheet" type="text/css">
<script src="/js/video.js"></script>
<!--<![endif]-->
<!--[if gte IE 9]>
<link href="/css/video_popup.css" rel="stylesheet" type="text/css">
<script src="/js/video.js"></script>
<![endif]-->
</head>
<body>
<video id="videoContainer" class="video-js vjs-default-skin" controls preload="none" width="480" height="360"
poster="<%= VideoImage %>"
data-setup="{}">
<source src="<%= VideoMp4 %>" type='video/mp4' />
<source src="<%= VideoOgv %>" type='video/ogg' />
<object id="flash_fallback_1" class="vjs-flash-fallback" width="480" height="360" type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf">
<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
<param name="allowfullscreen" value="true" />
<param name="flashvars" value='config={"playlist":["<%= VideoImage %>", {"url": "<%= VideoMp4 %>","autoPlay":false,"autoBuffering":true}]}' />
<img src="<%= VideoImage %>" width="480" height="360" alt="Poster Image" title="No video playback capabilities." />
</object>
</video>
</body>
</html>