How to play a video on the default media player on Windows? - asp.net

Here is the scenario: When you click on the image on homepage, the video should open. It should not be embedded video in a browser. Video should open in a default player. No browser window.
I have a static image on my homepage. When i click this image, i just require the video to run on the default player. The video file is located on the server.
Is it possible or not? And if possible then how can we achieve it?

How about setting proper HTTP headers that enforce to download & open given video?
Content-Type: application/force-download
Content-Disposition: attachment; filename="video.avi"

To make this work you need to use the *.avi extension at the end of your file, and place it on a link.
Now, the behavior will be different on each computer. The browser will ask the user to save the file somewhere and then if the user click on it will be open with the default player. Or in some cases it may direct ash him to open it with the default player, the browser saves it and then play it.
Now so good user interface.

Related

Prevent download of MP3 files in wordpress

I know many people asks the opposite of what I am asking. I am trying to make browsers play the file instead of downloading when opening the mp3 files´ link. I do not care if the users download the file after that, but I need the browsers to play the file at first, instead of automatically downloading. It happens in computers and smarthphones.
, b
I don´t know if it is something I have to change in .htaccess file or somewhere else. The link to the site is this: https://cefadchurch.com/sermones/predicas-dominicales/
Try the download button. If you see, it directly sends you to the file´s link, but it starts downloading instead playing. I know a "Download" button function is obviously to make the browser download the file, but that will not be the case for me, because however, if the button sends me to the file´s link, I rather the browser play instead download, and the company has asked me for that function.
In your response headers, you're actively forcing the download in two ways:
Content-Disposition: attachment
Content-Type: application/octet-stream
Firstly, the Content-Disposition header value of attachment forces a download to occur. You must get rid of it if you want to not have a forced download.
Next, the content type of application/octet-stream is the generic binary type, and thus the browser doesn't know how to render it so just downloads it as a file to let the system handle it. If you're sending MP3s, use audio/mpeg for the Content-Type response header.
Finally, not all browsers can/will play media in a tab when you link to the media directly. If you want the file to play in-browser, you need to embed it into a web page with the <audio> tag.

How to add automatic toggle into video

I have JWPlayer for Wordpress from ilghera. I use it for my website and i'm publishing video content in my site. This plugin that i use from ilghera gives me the option to add different qualities for a video but they only work manually.
I want my users to open the video just like a youtube video and video itself changes the quality due to users internet connection speed.
Can anyone help me? And whats the price for such a software etc.
The behavior/technology you described is adaptive bitrate (ABR), which uses real-time bandwidth data to switch between higher and lower resolutions of a video.
In order to take advantage of ABR, you must use a video format that supports it, such as HLS (files with .m3u8 extension) or MPEG-Dash (.mpd). You can see an example stream here.
If one of these streams is configured, JW Player will handle ABR and resolution switching automatically. If you are using JW Player's platform technology (i.e. Dashboard), and upload a video, HLS conversions are provided for you.
I've converted my mp4 file to m3u8. Created a playlist same as https://docs.peer5.com/guides/production-ready-hls-vod/ in this link shows. But when i try to play it on http://stream-tester.jwplayer.com it gave me 232011 error code.
Update**
I've solved the problem. Ffmpeg was working fine but only problem was jwplayer and hlsplayer.net were given me the same error which is cross domain access denied. So opened the apache and gave this command :
Header set Access-Control-Allow-Origin "*"
It worked!

Prompt video file for download over http instead of initating stream

I'm trying to setup a download page for some video files to mobile devices.
Ideally, I'd like it if I click or navigate to a download link, I'm prompted to download the file (or the file automatically downloads).
Currently, I navigate from my mobile device to:
192.168.1.4/Star.avi
And the video starts playing.
Is there anything I can do server side to prevent this?
Thanks.
Add the header field below:
Content-Disposition: attachment

Forcing the browser to pop a save as dialog box from a link pointing to remote url

I am building a web app that lets the user directly download files on a cdn by clicking a link. The link should point to the cdn url directly in order to minimize the load on our servers.
We would like the to have the browser pop up the save as dialog box when the user clicks the link to download the file and not have the browser display the content of the file at all. So the page should not reload. However, we don't have access to setting the HTTP headers sent back from cdn. Is it possible to still pop up the save as dialog box for download using client-side code?
Is it possible to still pop up the save as dialog box for download using client-side code?
No. Unless the file type is something the browser does not understand (or the HTTP header Content-Disposition is "attachment"), the "Save As" dialog will not appear.
This behavior cannot be changed by JavaScript.
The behavior is controlled by the Content-Disposition header, unless the browser simply doesn't understand how to display content of the type returned. Without the ability to change the Content-Disposition header to attachment, you can't force the browser to download the file instead of render it. This must be done server-side.

PNG, Why is visual studio making me download PNG files?

i write and my page loads it find. When i click on the link instead of having the image show on screen it promps me to download it. Why? How can i make it display in the browser? gif and jpg both display in the browser.
-edit- i am using FireFox 3.5 there is no code that serves it, its just a link and the file exist in my folder. The link is like http://localhost:1737/a/b/file.png. IE 8 displays the png w/o making me download. I havent tried with other browsers but surely i click on direct png link in firefox on every site mine (in VS) should act the same.
If you're fetching it with HTTP, then there is a web server serving it. Look at the MIME-type when its returned, is that set correctly?
Telnet to localhost on port 1737 (not sure the syntax on Windows but IIRC try telnet localhost 1737) and type:
GET /a/b/file.png HTTP/1.0
Followed by two returns. Look at the Content-Type: field in the header. If it's not something like image/png you have a problem serving it. Firefox may have been guessing from the file name.

Resources