我们可以直接链接播放视频吗? [英] can we play the video with direct link
本文介绍了我们可以直接链接播放视频吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想播放视频而不将其存储在解决方案中。我只是直接在我的数据库中保存该链接。是否可以在解决方案或任何地方播放视频。
喜欢这个
mediaelement.source =www.xxxx / videos / aa.com;
任何建议PLZ ..
编辑(从OP的评论中复制粘贴)
我试过像这样的uri ..
playVideos.Source = new Uri(http://channel9.msdn.com/coding4fun/articles/MissionControl-A-Flexible-API-for-Remote-Device-Control,UriKind.Relative);
我得到以下错误。
无法创建相对URI,因为'uriString'参数表示绝对URI。
当我像这样chnage
playVideos.Source = new Uri(MissionControl_mid.mp4,UriKind.Relative);
它的工作原理
这里视频(MissionControl_mid.mp4)已保存在我的clienbin项目中。
所以我的问题不是提供我项目的视频。我想在那里给出直接的URL ...
I wanna play a video without storing it in solution. Im just saving that link directly in my DB. Is it possible to play a video with out storing in solution or any where.
Like this
mediaelement.source="www.xxxx/videos/aa.com";
Any suggestions plz..
EDIT (Copy-pasted from OP's comment)
I tried with uri like this..
playVideos.Source = new Uri("http://channel9.msdn.com/coding4fun/articles/MissionControl-A-Flexible-API-for-Remote-Device-Control", UriKind.Relative);
Im getting following error.
A relative URI cannot be created because the 'uriString' parameter represents an absolute URI.
When i chnage like this
playVideos.Source = new Uri("MissionControl_mid.mp4", UriKind.Relative);
It works
here the video (MissionControl_mid.mp4) is saved in my project in clienbin.
So my problem is instead of giving the video which is my project. I wanna give direct url there...
推荐答案
UriKind.Relative告诉Uri类从当前页面的地址和传入的字符串构造Uri换句话说:传入的字符串应解释为相对于当前位置!
错误告诉您无法从绝对Uri创建相对Uri! http://channel9.msdn.com是一个绝对的Uri。
你需要做的是将Uri创建选项更改为UriKind.Absolute或完全省略它...
UriKind.Relative tells the Uri class to construct the Uri from your current pages' address and the string passed in - in other words: the string passed in should be interpreted as relative to current location!
The error tells you that you can not create a relative Uri from a absolute Uri! http://channel9.msdn.com IS an absolute Uri.
What you have to do is change the Uri creation option to UriKind.Absolute or omit it totally...
我尝试使用HTML5标签播放Youtube视频,也尝试使用在线任何类型的视频
< embed width =420height = 315id =正在播放runat =server/>
代码背后
string url = Convert.ToString( Youtube网址);
Response.Redirect(网址);< / pre>
它工作....:)
I tried with HTML5 tags for a Youtube video,and also for any type of videos in online
<embed width="420" height="315" id="playing" runat="server"/>
In code behind
string url = Convert.ToString("Youtube url");
Response.Redirect(url);</pre>
Its worked....:)
这篇关于我们可以直接链接播放视频吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文