I'm creating a mediaplayer website where I can play my uploaded videos.
I'd like to add a button where an user can click and the devices asks with which app play the video.
I tried something like that:
window.open("video.mkv", '_blank');
But the browser on my android device just download the video without reading the file as a playable video with an external player.
Is this something related to the browser or I can give a hint to the browser on how to open the file?
I think that if the click on the link directly downloads the file is because the device hasn't any app that has explicitly told the system that it can manage that kind of content.
Or if you use a regular link <a>...</a> instead of a window.open you can add some mime/type information to the link, it maybe helps...
Or keep the window.open and add some extra information as defined here: https://developer.mozilla.org/en-US/docs/Web/API/Window/open
Related
i want to create a video learning site.
I want people can't get to download my videos.
how to hide element attribute in inspection browsers because people can't get the video URL in inspection browsers
how to disable download button in video element
You can't hide a HTML element from the browser. You could create a seperate website which host the video's but doesn't show the real link to the video (proxy website) and only allow the ip-address of the "front-end" website to access those videos.
It's simply not possible. It will be visible in the HTML source code anyways. Only server-side code won't appear in the page's source on client-side.
Sidenote: Even if you could hide the video tag or the video's URL in the source, the browser should download the video itself which can be found in Chrome (or other browser's) Developer Console.
I have a quite specific issue regarding Chrome's new feature where they stop autoplaying videos.
On our site we wanted the page to load as quickly as possible, so only insert a new Vimeo embed object when a user has chosen to click to watch a video. Eg. the showreel on our homepage:
https://www.splinter.co.uk/
The problem arises because we use our own custom play button, so Chrome doesn't recognise that as a user-interaction, so it doesn't think that the user has chosen to view the video, therefore it blocks the autoplay option (which works fine in Safari).
I wondered if anyone else has had this problem, and if anyone can think of a workaround?
Thanks!
On the VOD home page of Vimeo you can find a technique that is used for a case like this. https://vimeo.com/ondemand
You can preload the Vimeo player when the user hovers over your custom play button so that at the time they click the Vimeo player.js API can be used to initiate playback. player.play()
If that is not sufficient it might be needed to load the player on page load and just keep it hidden, on the button press reveal the player and use the API to initiate playback.
I have several YouTube videos embedded on a webpage. To be more specific, the page has one single iframe and links to several youtube videos - I use the target attribute to force these links to open within the iframe.
For users on mobile, I'd like the videos to open within the YouTube app (if they have it installed). This is the default behavior for YouTube links, however, it doesn't happen in my case because the links target the iframe so it just causes the video to embed on the page and then play within the browser.
My guess is the easiest way to do what I'm looking to do would be to use javascript to change the target attribute(s) just on mobile. However, I'm open to other ideas to achieve this as well.
I want to add a button on the embedded youtube video on my website. So that a user can easily download that video. Now I just need to display a button on youtube video surface ,so that a user can click the button and do some job (about the video). Button will be like this:
Click Here to see
with simple html or javascript. Thank You.
Adding a button on top of your iframe is the simple part of the solution, and you will likely find this solution helpful. to match the styling, I'd recommend a site like http://css3buttongenerator.com/
As for the second part of this question, it is more advanced to write javascript to download a video, and if you'd like to avoid that, a simpler solution would be to redirect a user to a site like this. you could even go through the steps of downloading the video, and get the final link the site provides when it is ready to download.
I built a WPF application that attempts to navigate to a URL in Youtube that contains a video. I want the video to be played in full screen mode when opened as if the user manually clicked the full screen mode button. I know that such things can be done using Javascript. Can someone show me the way how to do it in a WPF application using Visual Studio? Or is there another way to do this?
Appreciate it.
You can change the URL to an embedded one, just parse the video id from URL and
use the following format, still not full screen though.
"https://www.youtube.com/embed/{0}?autoplay=1"
Ex:
https://www.youtube.com/embed/UkWd0azv3fQ?autoplay=1