媒体Web部件播放不了sharepoint中的视频

Sniper 2010-02-21 11:32:38
在"更改媒体"时选择一个视频后,返回"该URL可能是无效的图像URL.是否接受此URL?".确定后,完成编辑,打开页面,视频打不开,显示个"Failed".不知道哪位大侠有解?
...全文
365 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
Oo云 2010-08-20
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 yk298107461 的回复:]
细节自己把握! 可qq留言探讨:298107461
[/Quote]
很牛!
yk298107461 2010-08-17
  • 打赏
  • 举报
回复
细节自己把握! 可qq留言探讨:298107461
yk298107461 2010-08-17
  • 打赏
  • 举报
回复
一,直接用MOSS库配置开发:http://www.cnblogs.com/jianyi0115/archive/2008/04/28/1175259.html
二,用转换后的flv库(自己开发):
1,截取moss上传方法(加事件)
using System;
using System.Collections.Generic;
using System.Text;

using Microsoft.SharePoint;
using System.IO;
using System.Xml;
using System.Diagnostics;
using System.Threading;

using TNPJVC.Video.Model;
using TNPJVC.Video.BLL;
using TNPJVC.Pattern;

namespace MyEventHandler
{
public class VideoSPItemEventReceiver : SPItemEventReceiver
{
private string sXmlPath;
private MyXml xml;
private string sMyLogPath;
private Log log;
private VideoInfo mVideo;
private Videos bVideos;

public VideoSPItemEventReceiver()
{
ServerFactory.ApplicationType = ApplicationType.APP;
sXmlPath = VideoInfo.XmlDefaultPath;
xml = new MyXml(sXmlPath);
sMyLogPath = xml.ReadXmlNode("LogPath");
log = new Log(sMyLogPath);
mVideo = new VideoInfo(sXmlPath);
bVideos = new Videos();
}

public override void ItemAdding(SPItemEventProperties properties)
{

#region 自定义事件
string sResult = "";
if (bVideos.GetVideoInfo(mVideo) == "OK")
{
sResult = bVideos.CheckFile(properties.BeforeUrl, mVideo);
}

#endregion

#region 系统事件
if (sResult != "OK")
{
log.MyWriteLine("properties.ListItem.Delete()");
properties.Cancel = true;
properties.ErrorMessage = "上传失败:" + sResult;
}
else
{
base.ItemAdding(properties);
}
#endregion
}

public override void ItemAdded(SPItemEventProperties properties)
{

#region 自定义事件
string sResult = bVideos.GetVideo(properties, mVideo);
#endregion

#region 系统事件
try
{
if (sResult.StartsWith("OK"))
{
//base.ItemAdded(properties);
string[] arrResult = sResult.Split('|');
properties.ListItem["CatchFileName"] = arrResult[1];
properties.ListItem["CatchImgName"] = arrResult[2];
if (arrResult.Length > 3)
{
properties.ListItem["CatchFileTimes"] = arrResult[3];
}
properties.ListItem.Update();
}
else
{
properties.ListItem.Delete();
log.MyWriteLine("properties.ListItem.Delete()");
}
}
catch (Exception ex)
{
log.MyWriteLine(ex.Message);
}
#endregion
}
}
}
2,注册事件
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

using Microsoft.SharePoint;
using TNPJVC.Video.Model;
using TNPJVC.Video.BLL;
using TNPJVC.Pattern;
using System.Threading;

namespace MyEventHandler.Register
{
class Program
{


public Program()
{

}

static void Main(string[] args)
{

Control.CheckForIllegalCrossThreadCalls = false;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);


Program mProgram = new Program();
mProgram.SetRegister();
}

public void SetRegister()
{
ServerFactory.ApplicationType = ApplicationType.APP;
CmnSrvLib cmn = new CmnSrvLib();

Log log = new Log();
try
{
string sXmlPath = Application.StartupPath + "/VIDEO.xml";
MyXml xml = new MyXml(sXmlPath);
string sMyLogPath = xml.ReadXmlNode("LogPath");
log = new Log(sMyLogPath);

string sSite = xml.ReadXmlNode("SPSite");
string sWeb = xml.ReadXmlNode("SPWeb");
string sList = xml.ReadXmlNode("SPList");
SPSecurity.RunWithElevatedPrivileges(delegate() //用此方法模拟管理员账户运行此事件处理程序
{
using (SPSite site = new SPSite(sSite))
{
SPWeb web = site.OpenWeb(sWeb);
SPList list = web.Lists[sList];
list.EventReceivers.Add(SPEventReceiverType.ItemAdding,
"MyEventHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b2279c3d7a7333c0", "MyEventHandler.VideoSPItemEventReceiver");
list.EventReceivers.Add(SPEventReceiverType.ItemAdded,
"MyEventHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b2279c3d7a7333c0", "MyEventHandler.VideoSPItemEventReceiver");

log.MyWriteLine("EventHandler.VideoRegister,OK!");
Log.WriteLine("EventHandler.VideoRegister,OK!");
Console.WriteLine("EventHandler.VideoRegister,OK!");
}
}
);
}
catch (Exception ex)
{
log.MyWriteLine("EventHandler.VideoRegisterFailure:" + ex.Message);
Log.WriteLine("EventHandler.VideoRegisterFailure:" + ex.Message);
Console.WriteLine("EventHandler.VideoRegisterFailure:" + ex.Message);
}
finally
{
Thread.Sleep(3000);
}
}
}
}
3,写webpart/查询/绑定链接
4,链接地址/自己写播放页。

5,一,注意点:
1,拿掉视频WebPart部署文档文件及所有子文件只读属性
2,web.config设置
3,VIDEO.XML设置
4, 创建栏错误时,给IE工具\自定义级别最大权限。Error: 'helperFrm' is null or not an object
4.1 高级设置/内容类型/选择“是”/确定
4.2 文档/列表内容类型信息/父级:文档
4.3 栏/从新网站栏添加
5, 若抓取文件要放到其他路径,
请先修改c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\IMAGES\TNPJVC\TNPJVC.X.WEB\WEB\Library\VIDEO\VIDEO.xml
<WebCatchType>Http</WebCatchType>
<HttpCatchFilePath>http://ts-mosstest:80/TNPJVC.WEB/Library/VIDEO/CatchFile/</HttpCatchFilePath>
<HttpCatchImgPath>http://ts-mosstest:80/TNPJVC.WEB/Library/VIDEO/CatchImg/</HttpCatchImgPath>
<FilePath>p:/TNPJVC/TNPJVC.X.WEB/WEB/Library/VIDEO/UpFile/</FilePath>
<CatchImgPath>p:/TNPJVC/TNPJVC.X.WEB/WEB/Library/VIDEO/CatchImg/</CatchImgPath>
<CatchFilePath>p:/TNPJVC/TNPJVC.X.WEB/WEB/Library/VIDEO/CatchFile/</CatchFilePath>
修改 站点下虚拟目录TNPJVC.WEB 路径 P:\TNPJVC\TNPJVC.X.WEB\WEB
COPY c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\IMAGES\TNPJVC
到 P:\TNPJVC
修改11,Frm.Video\运行文件\VIDEO\VIDEO.xml;7,EventHander.Register\VIDEO.xml


二,细节:
1) 拿掉视频WebPart部署文档文件及所有子文件只读属性
2) 站点web.config下,修改为
<trust level="Full" originUrl="" />
3) 站点安装1,Ajax。
4) copy 2,wpresources\TNPJVC 到 C:\Inetpub\wwwroot\wss\VirtualDirectories\站点\wpresources\
5) 站点新增 3,样式库\
6) 站点新增 4,母版页和页面布局。
7) 站点网站母版页设置 指向 /Style Library/Top2Style/tstop2.css
8) 站点 下新增 视频文档库网站(选 文档中心)
9) 视频文档库网站 下 新增 视频文档库
10) 视频文档库/设置/文档设置/创建栏:VideoDesc,CatchFileName,CatchImgName,CatchFileTimes字段。
11) 修改 5,WEB\TNPJVC\TNPJVC.X.WEB\WEB\Library\VIDEO\VIDEO.xml,特别是<SPSite>http://dhc-pvwmpiui6k3:8080/</SPSite> <SPWeb>Document</SPWeb><SPList>视频文档库</SPList>
12) copy 5,WEB\TNPJVC到
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\IMAGES\
13) 新增 站点下虚拟目录TNPJVC.WEB 路径 C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\IMAGES\TNPJVC\TNPJVC.X.WEB\WEB ,注意读取.写入权限,,虚拟目录/应用程序池/选择当前站MOSS点(TS-MOSS);目录安全性/编辑/勾选启用匿名访问和集成Windows身份验证;ASP.NET/ASP.NET Version选择2.0.50727;HTTP头/MIME类型(M)点击/点击新建/扩展名:flv;MIME类型(M): flv-application/octet-stream

先卸载原有的dll
14) 拖放 6,MyEventHandler\下所有dll 到 C:\WINDOWS\assembly\
15) 修改 7,EventHander.Register\VIDEO.xml
重新启动IIS
16) 运行 7,EventHander.Register\VIDEO.xml\MyEventHandler.Register.exe
重新启动IIS
17) copy 8,MyWebPart\Debug\下文件 copy到 C:\Inetpub\wwwroot\wss\VirtualDirectories\站点\bin\下
18) 运行 WPManager2007\WPManager2007.exe 部署浏览 8,MyWebPart\Debug\MyWebPart.dll
19 新增 VideoList页面,模板页选择VideMaster,添加WebPart,编辑视频播放地址 http://ts-mosstest/TNPJVC.WEB/VIDEO/VIDEO005.aspx。
20) 修改 10,MyHands\VIDEO.xml
21) 运行 10,MyHands\MyHands.exe
22) 新增 控制面板/任务计划 对应 10,MyHands\MyHands.exe。
23) 修改 11,Frm.Video\运行文件\VIDEO\VIDEO.xml
24) 运行 11,Frm.Video\Frm.Video.exe




............
细节自己把握! 可qq留言探讨:298107361
jenny0810 2010-08-09
  • 打赏
  • 举报
回复
save
yk298107461 2010-08-03
  • 打赏
  • 举报
回复
1,写webpart/查询/绑定链接
2,链接地址/自己写播放页。
Justin-Liu 2010-03-04
  • 打赏
  • 举报
回复
还是没明白 详细一些……
time_is_life 2010-03-03
  • 打赏
  • 举报
回复
因为需要身份验证。除非改成允许匿名访问。
Justin-Liu 2010-02-21
  • 打赏
  • 举报
回复
说得详细一些……
回复内容太短了!

3,245

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 SharePoint
社区管理员
  • SharePoint社区
  • 霖雨 - LinyuLoveTJ
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧