I am trying to embed a local mp4 file that resides on the same server where IIS runs but on a different disk and is not part of the site (too many videos to do that). For example, my site is under C:\inetpub\wwwroot\Site while mp4 files I'd like to play are under D:\Videos. User running the site has access to this location. When I put full path to the file in the source, video does not play. What is the best way to handle this?
<video width="640" height="360" controls="controls">
<source src="D:/Videos/VideoFile.mp4" type="video/mp4" />
</video>
You don't have the right to do that, you need virtual path and not a physical one just put mp4 file inside your project directory and then specify path as...
Try using 'http://[Your server]/directory/yourmp4.mp4' or use Server.MapPath() as src of your object.
and make sure your browser supports video tag as it is a html5 tag.
Related
I'm using VSTFS 2018 Version 16.131.28226.3
When I edit a wiki page on one of my repositories and drag and drop a video on the page, it successfully adds the video to the .attachments directory and I add this to the 'src' property of the video but no video is ever displayed. The examples on Microsoft's tutorials on TFS surrounding adding html video to a wiki all involve external video sources.
Can anyone confirm what I'm trying to do actually works?
<video width=400 controls>
<source src=".attachments/InvoiceSearch0001-2634-dd51e9fa-ce57-4b0f-a5d6-c9450a9e6036.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
I got it to work by doing the following:
the format I was using above doesn't work
Go to Microsoft Docs for TFS Wiki and follow the format they show for adding HTML video or just refer to example below.
For some reason I can't use a relative path like I could for an image.
How to get path of video:
Go to the repository of your wiki and browse the video file within the .attachments folder. You'll see a little link for "Click to download file to your computer".
Right click on the link and copy link.
Paste this link replacing the src below
Example shown from MS docs:
<video src="https://sec.ch9.ms/ch9/7247/7c8ddc1a-348b-4ba9-ab61-51fded6e7247/vstswiki_high.mp4" width=400 controls>
While trying to embed html5 <video> tag in my salesforce web Page, I came across a wonderful library called "Videojs" (http://videojs.com/getting-started/). It served most of the purpose, however when I tried to play a video on Ipad, it failed. Then I came across this link (VideoJS: not working on IOS), which says to try to use videojs's default movie as there possibly could be encoding issue. When I did as per the suggestion, I came with a very interesting scenario. As When I fed the url(http://vjs.zencdn.net/v/oceans.mp4) directly as:
<source src="http://vjs.zencdn.net/v/oceans.mp4" type="video/mp4" />
it worked fine both in windows and in ios. But when I downloaded the same video and saved it to Salesforce CRM Content libraries and gave the src path as:
<source src="/sfc/servlet.shepherd/version/download/id" type="video/mp4" />
it worked in windows desktop browsers but not on ipad(version 9.2). I couldn't understand the issue.
Thanks for any help/ideas/suggestions.
I am googling mostly encoding issue for mp4 file or hugesize file,so use handbreak (https://handbrake.fr/). solve the problem
I have a very similar question to Play a Shoutcast Stream on iPhone with HTML5, but with a few differences...
I have an Icecast server running on Ubuntu 14.04 LTS, streaming an mp3. The setup follows Icecast's documentation exactly, is linked from an <audio> HTML5 tag on a website running on AWS EC2 and works in my desktop / laptop browser.
However, when I try to load the same website in iOS, on either my iPhone or my iPad, the HTML5 audio player loads, shows "Loading..." for several minutes, then either displays nothing or "Error".
The HTML5 code is as follows:
<audio controls>
<source src="http://xx.xx.xx.xx:8000/example1.mp3" type="audio/mpeg" />
</audio>
Suggestions or ideas as to why this doesn't work in iOS?
I finally got this resolved, but realized I never posted an answer.
I had to set the <audio> src value to the streaming mount point found in my icecast.xml file.
So, in my icecast.xml file, I have:
<!-- You may have multiple <listener> elements -->
<listen-socket>
<port>8000</port>
<bind-address>123.456.789.012</bind-address>
<shoutcast-mount>/stream</shoutcast-mount>
</listen-socket>
Thus, my HTML5 <audio> tag became:
For good measure, I also included the mime_type of audio/mpeg and controls to the <audio> tag, though these are not required.
I have an mp3 file saved in my assets/audio folder and want to play it using the html 5 player. However, when I load my page I always get a 404 not found error for that resource. Wondering if I am doing this wrong.
In view.html.erb
<audio src="app/assets/audio/bensound-acousticbreeze.mp3" type="audio/mpeg" controls>
Your browser does not support the audio element.
</audio>
I have verified multiple times that the full path is correct. Any help would be appreciated
UPDATE:
Found this while looking up a few things to answer the question. Better than any other solution here is to use the built-in audio_tag. This does remove the alternate text option though, so there's that. Still, here's the doc page.
Have your tried audio_path or asset_path?
That would look like this:
<audio src="<%= audio_path 'audio/bensound-acousticbreeze.mp3'%>" type="audio/mpeg" controls>
Your browser does not support the audio element.
</audio>
or
<audio src="<%= asset_path 'audio/bensound-acousticbreeze.mp3'%>" type="audio/mpeg" controls>
Your browser does not support the audio element.
</audio>
You should simplify by keeping your audio in the audios dir as seen in the docs. Then it would just be:
audio_path "bensound-acousticbreeze.mp3"
All together with the html:
<audio src="<%= audio_path 'bensound-acousticbreeze.mp3'%>" type="audio/mpeg" controls>
Your browser does not support the audio element.
</audio>
Apparently all rails assets get collapsed down into the assets directory, even if they are in sub-directories. The correct path was just "assets/bensound-acousticbreeze.mp3."
To anyone having trouble like this, it helped me to compare the path of the missing asset with the one I wanted to load to see what the difference was.
I have tried everything I possibly could, but I was not able to solve this. I am trying to display an mp4 video using an HTML5 video element in IE9 and IE10. In IE9 I get a blank square where the video is supposed to show and in IE10 it says "Invalid Source". It plays fine in Chrome.
The video displays fine within a simple HTML file, but not in my ASP.net MVC project, whether run locally or on a web server. I have the file placed in my root folder (same folder as the web.config)
Here is my code in my ASP.NET MVC index.cshtml:
<video controls style="position:inherit" >
<source src="ExplainerVideo.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
</video>
Any ideas?
Thanks.
Try taking away the codec and letting the browser decide for itself whether it can play it or not.
e.g. <source src="ExplainerVideo.mp4" type='video/mp4' />
Failing that, try an absolute URL for the video as I've noticed this causing issues on IE before.