hta brings up view and track downloads message - hta

I have a bunch of links to videos in a hta file and I want the links to open VLC media player in full screen to view them. This is what I have so far:
<HTML>
<HEAD>
</head>
<body>
Video 1
Video 2
Video 3
Video 4
</body>
</html>
This is working fine, but I get a "view or track downloads" window that pops up and asks me if I want to download the files or open it. If I select "open" it opens VLC and plays the video, but I'm trying to find a way to stop this popup from happening. I have been searching for days and can't find an answer. I'm using ie11 on win8.1. Any help would be greatly appreciated.
Also if I use Windows Media Player instead of VLC the message doesn't pop up, but I'd prefer VLC if I can get it to work.
Thank you for your time.
Greg

You can use objShell.Run command with some vbscript to open the mp4 files when you click the links. Try the code below.
<HTML>
<head>
<script language="VBScript">
Dim oShell
function openit(myFile)
Set objShell = CreateObject("Wscript.Shell")
objShell.Run myFile
end function
</script>
</head>
<body>
Video 1
Video 2
Video 3
Video 4
</body>
</html>

Related

Server side Rendering shows output as HTML string rather properly formatted HTML

My site is using Angular 10 (With server side rendering). I referred to https://angular.io/guide/universal to convert the site into SSR. Everything is working fine. 'View Source' shows me the content, I can share with Social Media. My node server does not give me any error.
The only issue I am facing is - When it is rendered through the node server, it shows as HTML string. For few seconds user sees below:
<!DOCTYPE html> <html> <head> </head> <body> <h3>Step 1 - Add environment variable </h3> <p> ......</p> </body> </html>
Later it switches back to properly formatted HTML. The same is the case with material icons used on site. I see them as strings initially.
Please check out the link https://ecokrypt.com/dashboard/article/detail/5e59df2b00190207e65d9e99/4.3---Angular%253A-Consider-Different-Environments
Slow network throttling shows the issue clearly. This is giving a very bad end-user experience. Am I missing any step in SSR? How can I handle this? I tried to search this issue on google, but no luck.

Youtube iframe API is not showing ads

I'm trying to put an embedded player inside a data url (to paste in the browser url bar) but every time it gets to the ads part the request gets a 400 error (Bad request). I just copied the code from this link, minified it and changed the video id to one with ads:
https://developers.google.com/youtube/iframe_api_reference
data:text/html, <!DOCTYPE html><html> <body> <div id="player"></div><script>var tag=document.createElement("script");tag.src="https://www.youtube.com/iframe_api";var player,firstScriptTag=document.getElementsByTagName("script")[0];function onYouTubeIframeAPIReady(){player=new YT.Player("player",{height:"390",width:"640",videoId:"LnFsp6iM5dg",events:{onReady:onPlayerReady,onStateChange:onPlayerStateChange}})}function onPlayerReady(e){e.target.playVideo()}firstScriptTag.parentNode.insertBefore(tag,firstScriptTag);var done=!1;function onPlayerStateChange(e){e.data!=YT.PlayerState.PLAYING||done||(setTimeout(stopVideo,6e3),done=!0)}function stopVideo(){player.stopVideo()}</script> </body></html>
When running it on a node server I also get these errors, so I can't get it to play ads either:
http://jsfiddle.net/7gyxgaqj/1/
What can I do? Am I doing anything wrong? Thank you in advance.

Open an HTML file in Adobe Brackets

I'm a very unexperienced programmer. I've been doing codeacademy javascript track but I found out that you need to put javascript in an HTML file? I want to make sure that I can write basic javascript before continuing on code academy so I downloaded brackets and when I tried to test my program with the live preview feature it said, "Open an HTML file or make sure there is an index.html file in your project in order to launch live preview. I typed this up very quickly so there are probably plenty errors but here is the code if that helps answer my question.
<!DOCTYPE html>
<html>
<body>
<h1> Daily Programmer Challenge 12/15/14 </h1>
<script type = "text/javascript">
var volume = prompt ("Enter the volume of the container that you wish to make");
var cube = math.pow(volume, 1/3);
window.document.write("The size of the container is '+cube+' width, '+cube+' high, and '+cube+' tall");
</script>
</body>
</html>
save this code that you pasted as a file called index.html and then try Bracket's live preview.
For everyone, this problem can be resolved by following steps:-
On menu bar, go to File --> Open Folder (folder which have your html file for live preview)
Select Folder
Select your html file from left side bar for live preview
Click on bolt icon on right (preview button)
All it melts down to the fact, that you need that folder(which have your file) selected to view your output in live preview.
Let me know, if it helps someone. :)

Play swf file on webpage

Hey guys I am trying to play a .swf file on my web page I have already tried to embed it using HTML and it works. But is there anyway of playing a .swf file after button click event in asp.net?
Before you get to carried away with using flash could I urge you to read this http://occupyflash.org/ and then invest a little of your time researching html5 (specifically canvas) :)... http://www.williammalone.com/articles/flash-vs-html5-canvas-drawing/ and this http://webdesign.about.com/od/html5tutorials/a/canvas-vs-svg-vs-flash.htm will give you a good start.
Edit
Without seeing your current code I can't give a precise answer but this should work:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<video src='insert-route-to.swf' id='insert-id-here' controls>
Your browser does not support HTML5 videos please Upgrade.
</video>
<button onclick="document.getElementById('insert-id-here').play()">Play</button>
<button onclick="document.getElementById('insert-id-here').pause()">Pause</button>
</body>
</html>
on button click
Response.redirect("file path");
something like:
Response.redirect("Video/abc.swf");
where "Video" is folder name which is present in project folder and "abc" is file name.

Embedding PDF from server in Browser

I have an ASP.NET web application.I have some PDF files in my server .I want to show those to the user via browser in a new window.how to embed PDF in a browser ? i want the save option to be available for the user to save the PDF .How to go ahead
take a look at
http://pdfobject.com/
<html>
<head>
<script type="text/javascript" src="/scripts/pdfobject.js"></script>
<script type="text/javascript">
window.onload = function (){
var success = new PDFObject({ url: "/pdf/sample.pdf" }).embed("pdf");
};
</script>
</head>
<body>
<div id="pdf">It appears you don't have Adobe Reader
or PDF support in this web browser.
Click here to download the PDF</div>
</body>
</html>
PDF files opened in the browser can be susceptible to XSS, so it is usually best to configure the server so that, when a user requests a PDF, it is opened in it's native application e.g. Adobe Reader.
To configure IIS, open up IIS Manager and:
Right-click the folder on your site where the PDF files are kept and select 'Properties'
Go the the HTTP Headers tab
Click the 'File Types' button under the MIME Map section
Click 'New Type'
Add '.pdf' as the extension and 'appliction/octet-stream' as the Content Type
Click Ok and apply the changes
Now when the user clicks a link to a PDF they should be promted with the 'Open or Save' dialog box that you are after.
I've faced the same problem and a guy from Adobe has an (old) blog post about it link text
It works fine with IE, FF, Chrome with the default Adobe Reader plugin.
Now my only issue left is to display a nice loading thingy while the plugin retrieves the PDF file that is generated on-the-fly.

Resources