您好我正在开发MVC3中的Web应用程序。我创建了一个名为PlayLink的数据库,并将媒体播放器www.leanbackplayer.com集成到视图中。
从我的观点来看,用户可以向数据库添加URL链接,链接将显示在主视图中。我现在需要将播放器链接到存储数据库的url,这样当点击url时,关联的url媒体文件将在播放器中播放。
这是我的Lean Back播放器代码,它目前只播放预编码的网址。
<div class="leanback-player-video">
<video width="500" height="250" preload="auto" controls p oster="http://dl.dropbox.com/u/46705018/sintel.mp4.mp4">
<source src="http://dl.dropbox.com/u/46705018/sintel.mp4.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
<object class="leanback-player-flash-fallback" width="500" height="250" type="application/x-shockwave-flash" data="http://player.longtailvideo.com/player.swf">
<param name="movie" value="http://player.longtailvideo.com/player.swf" />
<param name="allowFullScreen" value="true" />
<param name="wmode" value="opaque" />
<param name="bgcolor" value="#000000" />
<param name="flashVars" value="controlbar=over&file=http://dl.dropbox.com/u/46705018/sintel.mp4.mp4
&image=http://dl.dropbox.com/u/46705018/sintel.mp4.mp4" />
</object>
<div class="leanback-player-html-fallback" style="width: 500px; height: 250px;">
<img src="http://dl.dropbox.com/u/46705018/sintel.mp4.mp4" width="500" height="250" alt="Poster Image"
title="No HTML5-Video playback capabilities found. Please download the video(s) below." />
<div>
<strong>Download Video:</strong>
<a href="http://dl.dropbox.com/u/46705018/sintel.mp4.mp4">.mp4</a>
</div>
</div>
</video>
</div>
MVC模型结构:
using System;
using System.Data.Entity;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace ProjectNCI.Models
{
public class PlayLink
{
public int ID { get; set; }
public string Title { get; set; }
public DateTime Date { get; set; }
}
public class PlayLinkDBContext : DbContext
{
public DbSet<PlayLink> PlayLink { get; set; }
}
}