I was wondering if it is possible to detect embedded flash media (as in grabbing the actual media url) on any webpage by just looking at the sourcecode. Some webpages actually include the media url in the 's parameters, but on many webpages the url is hashed or it's not there at all.
Applications such as Ant Video Downloader seem to have no problem with this and always manage to get the media url for you, but I'm guessing this is done by sniffing packets or by some similar approach.
Can it be done programatically? And if so, where to start?
Related
Today, during some other somehow related work, came across my mind the following question: How does ASP.NET detect browser capabilities? Is seems it can not from request header, as the this.Request.ServerVariables["ALL_RAW"] should reveal all request headers, but there is nothing about browser capabilities in there? They obviously are somewhere else. Where? How to get those raw data?
For clarification: this is not a question about how to get browser capabilities from ASP.NET. This one is simple (this.Request.Browser, here you can find all).
ASP.Net includes .browser files that map User-Agents to capabilities.
i need to add video streaming capabilities to drupal. I need this functions:
Some users must be able to create
content with video inside it. It must
be easy, the best idea would be
adding a new content type (rich
media) and then the user can choose
to either upload a video from his pc
or choose a video that has been
already uploaded
Registered user must
have the possibility to upload videos
that are viewed by a moderator before
publishing them
All video must stay on my server (privacy reasons and so on), what i'm asking is: is there any drupal modules that any of you has used that does such things?
for streaming video from my server do i need some special "video streaming server"?
i'v checked flowplayer as stated in this question, but i don't get if i need to setup some extras on the server or not.
EDIT - in case, has anyone tried to use Kaltura?
In the end i used the video module with the flowplayer module. Simple and very easy.
I built a WebTV Module on top of NaviCast Streaming API. I used flowplayer for playback. I also setup adStreamer plugin with flowplayer.
NaviCast is a paid service and gives you a desktop application to manage your videos.
I really recommend MediaFront. It is pretty much stand-alone (needs HTML5), and has a tutorial video. It is the only streaming solution that worked for me.
Dave Ward says,
It’s not exactly light reading, but section 4.2 of RFC 3986 provides for fully qualified URLs that omit protocol (the HTTP or HTTPS) altogether. When a URL’s protocol is omitted, the browser uses the underlying document’s protocol instead.
Put simply, these “protocol-less” URLs allow a reference like this to work in every browser you’ll try it in:
//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js
It looks strange at first, but this “protocol-less” URL is the best way to reference third party content that’s available via both HTTP and HTTPS.
This would certainly solve a bunch of mixed-content errors we're seeing on HTTP pages -- assuming that our assets are available via both HTTP and HTTPS.
Is this completely cross-browser compatible? Are there any other caveats?
I tested it thoroughly before publishing. Of all the browsers available to test against on Browsershots, I could only find one that did not handle the protocol relative URL correctly: an obscure *nix browser called Dillo.
There are two drawbacks I've received feedback about:
Protocol-less URLs may not work as expected when you "open" a local file in your browser, because the page's base protocol will be file:///. Especially when you're using the protocol-less URL for an external resource like a CDN-hosted asset. Using a local web server like Apache or IIS to test against http://localhost addresses works fine though.
Apparently there's at least one iPhone feed reader app that does not handle the protocol-less URLs correctly. I'm not aware of which one has the problem or how popular it is. For hosting a JavaScript file, that's not a big problem since RSS readers typically ignore JavaScript content anyway. However, it could be an issue if you're using these URLs for media like images inside content that needs to be syndicated via RSS (though, this single reader app on a single platform probably accounts for a very marginal number of readers).
The question of whether one could change all their links to be protocol-relative may be moot, considering the question of whether one should do so. According to Paul Irish:
2014.12.17: Now that SSL is encouraged for everyone and doesn’t have performance concerns, this technique is now an anti-pattern. If the
asset you need is available on SSL, then always use the https://
asset.
If you use protocol-less URLs to load stylesheets, IE 7 & 8 will download them twice:
http://www.stevesouders.com/blog/2010/02/10/5a-missing-schema-double-download/
So, this is to be avoided for CSS if you like good performance.
Yes, network-path references were already specified in RFC 1808 and should work with all browsers.
Is this completely cross-browser compatible? Are there any other caveats?
Just to throw this in the mix, if you are developing on a local server, it might not work. You need to specify a scheme, otherwise the browser may assume that src="//cdn.example.com/js_file.js" is src="file://cdn.example.com/js_file.js", which will break since you're not hosting this resource locally.
Microsoft Internet Explorer seem to be particularly sensitive to this, see this question: Not able to load jQuery in Internet Explorer on localhost (WAMP)
You would probably always try to find a solution that works on all your environments with the least amount of modifications needed.
The solution used by HTML5Boilerplate is to have a fallback when the resource is not loaded correctly, but that only works if you incorporate a check:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<!-- If jQuery is not defined, something went wrong and we'll load the local file -->
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.2.min.js"><\/script>')</script>
I posted this answer here as well.
UPDATE: HTML5Boilerplate now uses <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> after deciding to deprecate protocol relative URLs, see here.
If you would like to make sure all requests are upgraded to secure protocol then there is simple option to use Content Security Policy header upgrade-insecure-requests
Content-Security-Policy: upgrade-insecure-requests;
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/upgrade-insecure-requests
I have not had these issues when using ://example.com - but you do need to add the colon at the beginning. Yoast had a good write up about this a while back. But it's lost in his pile of blog posts.
this is my first time doing a gallery of videos using ASP.NET,
I believe there are many articles on the net regarding this, but I would like to see some recommendation and different point of view :
what are the tools used?
how to not allow user to download a video?
what the difference between vimeo,dimecasts.net choice , what about other choices?
Streaming?
any valuable information will be appreciated.
Dear sam you ask too many different question. I will try to give some answer to what I know.
First you need to select the way you go to show your video. One popular way is the flash. YouTube use flash.
So the tools that you can use is the one that convert the video to flash streaming file. There is all ready one from adobe. Other tools is video editing if this is what you asking for. Video editing with asp.net or with other programs like vegas video.
How to not allow a user to download a video ?, you serve this video from an ashx handler, this handler just read the video file from a protected directory and send it to the video player. The id of the file that is going to play you send the id on the page header, or from inside redirect to that page to hide it as much as you can, but expert users can find it and download it at the end. How ever you can avoid the scanning of your page by a robot that try to download them all. All this is not that easy but not that hard also. This task is a full question and a tutorial alone, and as I say I think that is near impossible to avoid at the end the user not get your video if he won it to.
Other way to protect your video is to scramble the streaming header, and then on your flash player decode it again back. That way even if they get them ,they can not play it anywhere.
About the streaming, adobe give a streaming server http://www.adobe.com/products/flashmediaserver/ but for small video files the flash player combinate with the flash video file can do almost the same work.
flash video player, I think that there are some if you google it, one of them is the flowplayer http://flowplayer.org/
You need to know to programming also flash and probably make communication with the video flash and your pages using Javascript, and modify the player to your needs. All of that its not an easy task, but there are many resources and tutorial that can help you.
So start with the flash video on google.
From tag "asp.net" I'm assuming that you deal with Microsoft technologies. Our team in the past had estimation project around selling video content, so you problem is close to it.
The base idea is usage of Microsoft Windows Media Services 9 Series( for brief overview look at
http://www.microsoft.com/windows/windowsmedia/howto/articles/webserver.aspx ). So this answer #1.
The most difficult question is #2. Because you can just reduce possibility to download, but to watch video user needs have some frames at client side. That is why content always can be intercepted. Following list is my recommendations how to reduce risks:
Use "Stream without downloading" (see article above for details) or broadcast
Manage stream content with Digital Rights Management
Use authentication of users that watch video and provide unique URL for them to disallow special tool of downloading to intercept results.
Question #3 relates to format war. Vimeo, youtube and many others use FLV format to provide video. In theory client-side player of vimeo can play without problem video from youtube and vice verse. The benefit of it is crossplatforming - Linux, Mac, Windows users can recognize this format and play it. On other hand usage of WMV (windows media) potentially can be restricted (in real I have never seen any problem). But usage of Microsoft formats are more secured since usage of Digital Rights Management tags embedded to content.
Answer on #4, #5 you can find in article above.
I would opt for using Silverlight. It has Digital Rights Management and Microsoft has some great tools for you like Expression Blend and Encoder.
For the streaming part you could use IIS smooth streaming.
Hi. I have uploaded a picture to show you the solution better. Now I want to tell you what does this image mean:
Upload Center: You must create upload center to upload your videos. So you need to create a user interface with upload controls. after upload, you should change video format to flash video files (Best file type is FLV). And at last step of upload files must save at specific directory ( I call it #VidDir) and you must get video a specific id (I call it #VidId). So file save at Directory/FileID
Generic Handler: This generic handler can open video (with flash video player) and create <embed> tag (or anything else) to show videos. note: to view video this generic handler must have query string (I call it #VidId).
Flash Video Player: You must create a flash video player or use another ready versions; But its better to create your self. (Its realy easy, trust me). This video player must configure to show videos from web page query string (that I call it #VidId).
At last there must be a web page to use generic handler.
Demo here.
ANSWERS:
1.what are the tools used?
Adobe flash: To create a video player. use can use flash FLV media playback tool for video preview. After that you can use buttons, movieclips, and graphics for customizing your user interface.
Its better to use other Flash video players (e.g->Flow player).
Generic handlers: Generic handlers are best way to picking elements. You can preview generic handlers in your ASP.NET page.
2.how to not allow user to download a video?
You can upload videos to your App_Data folder. To access this folder you must have server permission but generic handlers can access videos there.
3.what the difference between vimeo,dimecasts.net choice , what about other choices?
I dont know. You can take a look at Aparat persian video sharing center.
4.Streaming?
You can take a look at Adobe media server family.
This question already has answers here:
Mobile Device Detection in asp.net
(9 answers)
Closed 6 years ago.
I have an existing web site and I would like to create a mobile version of it that is more suitable. For instance, the main site uses drop-down menus and we all know those are quite the fail on mobile devices.
I would like to redirect to my mobile version (it will be a subdomain of the current site) if I detect a request from a mobile browser. So when they Google something and come to my site, they will automatically see the mobile version (just like Wikipedia).
Does ASP.NET provide an easy way of doing this? If not, how can I do it?
You can use the IsMobileDevice property somewhere in the Request.Browser. You need some decent browser definitions though. I use these excellent set of browser definitions: Ocean's place browser definitions.
They are really in depth and the best I've seen. I think he is currently working on .NET4 ones too.
I think the best solution is WURFL. It is more up date device description repository and it is free. The only inconvenience is .net api is GPL.
Keep it simple...
Heres the JS for the same...
Hope it helps someone..
var useragent = navigator.userAgent;
var isMobile = !!useragent.match(/iPhone|Android|Blackberry|Sony|Nokia|Motorola|Samsung/i),
isWebBrowser = !!useragent.match(/Mozilla/i);
// Redirect the call accordingly.
if(isWebBrowser && !isMobile)
//call to web portal
alert(" You seem to me... calling from Web Browser")
else if(isMobile)
//call to mobile apps
alert(" Call seems to be from Mobile device...")
else
{
// jus kiddin...
alert(" Unable to detect the device..... Please report to admin...")
}
There is a project on codeplex that you can use : Mobile Device Browser File
Project Description
The Mobile Browser Definition File
contains definitions for individual
mobile devices and browsers. At run
time, ASP.NET uses the information in
the request header to determine what
type of device/browser has made the
request.
This project provides a data file that
when used with ASP.NET will detect the
incoming mobile device and present you
as the web developer with a set of 67
capabilities or properties describing
the requesting device. These
capabilities range from screen size to
cookie support and provide all the
information you need to adaptively
render content for mobile phones and
devices.
What is the Mobile Device Browser Definition File?
The Mobile Device Browser Definition
File contains capability definitions
for individual mobile devices and
browsers. At run time, ASP.NET uses
this .browser file, along with the
information in the HTTP request
header, to determine what type of
device/browser has made the request
and what the capabilities of that
device are. This information is
exposed to the developer through the
Request.Browser property and allows
them to tailor the presentation of
their web page to suit the
capabilities of the target device.
There's an article on CodeProject which provides such function.