Running External Application( vlc player, text doc, .exe) using HTML and JS - javascript

How do i open a music file or a video file in VLC player or Window Media player by clicking a button on a webpage writter in HTML and JS.

This is not possible because it is managed by the client system. But... you could create a "pseudo protocol" in your system registry and assign it the VLC player.
For pseudo protocol I mean something like magnet torrent. ( magnet:?somedata )
Your pseudo protocol could be startvlc:yourdata.
Keep in mind that this operation must be done on all systems where you want to run your application.

Related

Cannot open a local file from webpage

I want to open files from webpage. For example when we try to download a torrent file it redirects us to utorrent app and it continues it work. I also want to open a local file somehow using OS software. Like a video file using pot player. Is there any possible solution for me ,like making a autorun in pc to run that . Anything it may be please help me.😔😔
I searched and found a solution to open a software using protocol, but in this way I cannot open a file in that software.
Opening a specific file in a specific software would usually depend on passing some URL parameters to the protocol-URL of the app (e.g., opening a file in VSCode would use a URL like vscode:///Users/me/file.html, but this functionality would have to be explicitly handled by the app itself though, so the solution for each app would be different).
Otherwise, if the app doesn't support opening a specific file itself through a URL, you'd have to use some scripting software (e.g. AppleScript if you're on macOS) to dynamically click/open certain programs on a user's computer.
the link acts as a magnet so your torrent application is opened maybe delete torrent for sometime till you finish the project, i know how to open image in local files in html but it will only be visible to you, you can do audio and video files also using <source src="movie.mp4 and on next line `type="video/mp4">

Open file in VLC from a href="path/of/file..WAV"

I'm looking a way to open a .wav49 on VLC with a link from my web app. Since files with .wav49 are not supported by <audio> tags. And I can't change the file type to a normal .wav or .mp3 due to several reasons.
The audio files are located in a shared folder on my server (which is a Windows Server 2016), so everyone on our network can access them.
The goal of my app is to make the audio file searching something easy.
I've been looking for options like change the format in backend and stream a .mp3 file to the audio tag or a plugin that allows to play .wav49 files but it seems that the easiest way is just to send the file to be opened on VLC.
The only I have for now is this
<a href="file:\\CENTRAL\path\audio.WAV">
I also tried with
<a href="file:\\CENTRAL\path\audio.WAV" download="test">
But neither works.
Only in Firefox, when I click the link ask me if I want to save it or just open it, but both of the options download the file. I don't want to download the file, I just want to launch an alert asking if the user wants to launch VLC and open the audio.
There are some examples of what I want to do, like roblox.com when a user click on the play button and he has the app installed, the browser launch the app on the local machine and gives the params of the game the user wants.
Another example is comodo remote control, when an user of comodo is in the web device manager and wants to begin a remote session, the user just click a button and an alert appears asking if the user wants to launch the remote control by Itarian app, if the user says yes, the app is launched in the local machine.
I found this Open video stream on VLC Player through the browser but it seems doesn't work anymore.
First of all, the standard path separator to be used here is a forward-slash, also if you want to link to a local file you need to use the file:/// prefix with three slashes. For network shares you would use two slashes: file://smbhost/path
So i would recommend you try the following:
<a href="file://CENTRAL/path/audio.WAV">
Hope this helps

Play YouTube video without invoking player that takes over the screen in phonegap android?

I'm creating an application in phonegap on android 2.3.5.
I have a YouTube video in my app which I want to display in a similar way it displays on a browser (namely inside the browser window), however clicking the video image invoke an external video player that takes over the screen.
Is there a way to play the video inside a window in my app without it taking over the screen (the same way it displays on a web browser)?
Thank you.
To install the plugin, move www/video.js to your project's www folder and include a reference to it in your html file after phonegap.{ver}.js.
Create a directory within your project called "src/com/phonegap/plugins/video" and copy "src/com/phonegap/plugins/video/VideoPlayer.java" into it.
In your res/xml/plugins.xml file add the following line:
Once installed you will be able to play a video by calling:
window.plugins.videoPlayer.play(url);
The url parameter can be one of three types:
The file:// protocol to play something native to the device such as:
window.plugins.videoPlayer.play("file:///sdcard/MyMovie.mp4");
The http:// protocol to play something on the internet such as:
window.plugins.videoPlayer.play("http://path.to.my/file.mp4");
The http:// protocol pointing to a video on YouTube such as:
window.plugins.videoPlayer.play("http://www.youtube.com/watch?v=E0UV5i5jY50");
As long as your url has "youtube.com" and contains the video ID (i.e. the v parameter) the VideoPlayer should be able to start the YouTube app on your phone to play the video without any additional user interaction. However, if the phone does not have the YouTube app you are out of luck. In the future I may add a check for this that will ask the user to install the YouTube app first.
Sadly at this point in time the VideoPlayer does not support playing videos from your android asset directory. That is an enhancement for a later date.
So, there you go a pretty simple and easy to use plugin which can get you unstuck if you really need to play a video in your Android PhoneGap application.

Attaching a camera video feed to html in Adobe Air

I am using the Adobe AIR SDK to develop an HTML/JavaScript app that needs to record video. I'm not using Flex or Flash Builder which can use <mx:VideoDisplay />
I know how to attach the camera video feed to a new window object via nativeWindow.stage. Is it possible to do something similar in a section of the html or an iframe? Or is there an html tag that AIR interprets like the <mx:VideoDisplay /> tag in ActionScript?
In the end the answer was not to attach the video feed to the HTML, but to load it in a Flash Player file. We ended up embedding JWPlayer into the app and having it play the video stream from the media server. However, something similar can be done to have a sort of video chat app. You can create a SWF file that implements the ExternalInterface class in ActionScript so you can expose necessary functions to JavaScript.

Play mms:// streams on my site

I'm building a "channel chooser" for a set of mms:// streams (Microsoft Media Server): a simple web GUI that lets the user chose which channel to listen to. For reference, here is the list of streams I'd like to use. I would like users to be able to play those streams on my site with a simple "play/stop" control. Nothing fancy.
How should I attack this? Any ideas or pointers appreciated! New angles and hacks around the problem too.
Javascript or Flash players are of course preferable, but I haven't been able to find any player that plays mms:// streams. My back-end language is Django if that helps anyone get any ideas.
MMS will require the user to have Windows Media Player installed. I believe you can embed mms:// content directly in an HTML page using <object> and/or <embed> tags and if it's installed, the WMP browser plugin will play the content.
Here's an Embedded Media HTML Generator; enter your mms:// url here and use the generated HTML in your video player page template.

Categories