What is the size of the video you're trying to upload? Vidoes are just treated as the type "File". So if you upload a video manually you need to go to the media section and create a media type of "File" and then use the upload option.
You can also just drag and drop the file where you want it.
If it's giving you a yellow screen it's most likely because you need to increase the maximum upload size in the web.config - You can see how to do that in Jeavon's first tip here http://24days.in/umbraco/2013/6-easy-configuration-tweaks/
Be aware that in .NET there is a limit of 2GB - So if the video is larger than that you need to consider another way of dealing with it using youtube/vimeo for instance if it's a public video - Then it can just be embedded onto your site using the embed code. Otherwise you can also consider simply uploading the video to a specific video folder on your file-system and then read it from there.
I tried to upload .mp4 video in file format under media section as you told. But when I click save button, the respective method which is under 'umbraco/backoffice/umbracoApi/Media/postsave' loaded for 3 mins 27 secs and threw '502 Bad Gateway' error.
Ok - But did you increase the max upload limit? If you don't do it the default is set to allow for uploading around 4mb - Again a thing related to the .NET framework.
So unless you increase the maximum allowed upload size you won't succeed.
However a 502 Bad Gateway error sounds weird...but try increasing the upload size if you have not already done so. If you still get the above error then you might need to adjust other settings as well - But frankly I can't remember those but will post if I come to think of them.
I changed web config. Now it works. But it takes nearly 3 and half minutes to upload....I have to wait each and every time without knowing whether it is uploading or not.... Now, I need to show those files in browser. I use razor code to read out details for videos like title, decription and video. The code displays everything but not video.....What is the syntax to show video in razor ?
I want to show videos in .flv, .wmv, .mp4, .swf formats. I can upload all formats of videos. But how can I display those videos in page. I need code for that..Before that, I need to whether it is possible or not ?
It is possible to show these videos. But depending on what devices you need to target you should know that you will most likely need the same video to be available in more formats to serve the broadest range of devices possible.
Ok, so in order to be able to have the videos displayed you need to
1: Fetch the path for the desired video (Razor)
2: Some <video> markup
3: Perhaps a JavasSript library to add some player actions like videojs for instance http://www.videojs.com/
The code you showed me above - Is that your full code? If not then please paste the full code. It makes it much easier to point things out you should correct etc.
Thanks for the code - I hope i'll have some time to have a closer look during the weekend. Don't have time to do it today. So unless someone else beats me to it I can't provide an example before sunday.
But you should not use "iframe" for embedding videos. It's the <video> tag you need HTML wise.
Sorry for the late reply - I fogot about it yesterday.
But below you can see my working code
@{
var mediaFolderId = CurrentPage.Videos;
}
@if(!String.IsNullOrEmpty(mediaFolderId.ToString())){
var mediaFolder = Umbraco.Media(mediaFolderId);
foreach (var video in mediaFolder.Children()) {
<video autoplay controls width="320" height="240">
<source src="@video.umbracoFile" type="video/mp4" />
</video>
}
}
In the above it seems like you're mixing up dynamics and strongly typed. My example is based on dynamics.
For each video you need to have some fallback options since browsers support different formats. This articles does a good job of explaining this http://diveintohtml5.info/video.html
So to be covered fully you'll need the same video in the .ogg, .mp4 and .webm formats.
I can't seem to upload MP4 videos into the media section at all. I followed that link and increased the upload size in the web.config, but I'm still only seeing this error:
Request error: The URL returned a 404 (not found):
/umbraco/backoffice/UmbracoApi/Media/PostSave
with data:
{"key":"contentItem","value":{"id":0,"properties":[{"id":0,"alias":"umbracoFile","value":{"selectedFiles":"video.mp4.mp4"}},{"id":0,"alias":"umbracoExtension","value":""},{"id":0,"alias":"umbracoBytes","value":""}],"name":"Example 2","contentTypeAlias":"File","parentId":1126,"action":"saveNew"}}
Contact your administrator for information.
The mimetypes are also in the web.config, so I don't know what's wrong. Is something messed up with my Umbraco installation since it's giving a 404? Uploading images are fine. I've been uploading JPGs and PNGs for a while now.
How to upload video in media section in Umbraco7 ?
Hi,
I need to upload videos as like as images in media section. I tried with 'upload' datatype. But it didn't work.
Hi Thomas
What is the size of the video you're trying to upload? Vidoes are just treated as the type "File". So if you upload a video manually you need to go to the media section and create a media type of "File" and then use the upload option.
You can also just drag and drop the file where you want it.
If it's giving you a yellow screen it's most likely because you need to increase the maximum upload size in the web.config - You can see how to do that in Jeavon's first tip here http://24days.in/umbraco/2013/6-easy-configuration-tweaks/
Be aware that in .NET there is a limit of 2GB - So if the video is larger than that you need to consider another way of dealing with it using youtube/vimeo for instance if it's a public video - Then it can just be embedded onto your site using the embed code. Otherwise you can also consider simply uploading the video to a specific video folder on your file-system and then read it from there.
Hope this helps.
/Jan
Hi Jan,
I tried to upload .mp4 video in file format under media section as you told. But when I click save button, the respective method which is under 'umbraco/backoffice/umbracoApi/Media/postsave' loaded for 3 mins 27 secs and threw '502 Bad Gateway' error.
Hi Jan,
I tried to upload 9mb video file...But it didn't save...
Hi Thomas
Ok - But did you increase the max upload limit? If you don't do it the default is set to allow for uploading around 4mb - Again a thing related to the .NET framework.
So unless you increase the maximum allowed upload size you won't succeed.
However a 502 Bad Gateway error sounds weird...but try increasing the upload size if you have not already done so. If you still get the above error then you might need to adjust other settings as well - But frankly I can't remember those but will post if I come to think of them.
/Jan
Hi Jan,
I changed web config. Now it works. But it takes nearly 3 and half minutes to upload....I have to wait each and every time without knowing whether it is uploading or not.... Now, I need to show those files in browser. I use razor code to read out details for videos like title, decription and video. The code displays everything but not video.....What is the syntax to show video in razor ?
Greetings, I have the same issue. How can I upload the video (mp4) in the Umbraco CMS ?.
Suniel Rampadarath
Hi Thomas
Ok, are you uploading on a local installation or are you uploading to a server? Could be the bandwidth...But good you got it working.
Could you provide the current code you're using? It will make it easier to give some advice.
/Jan
Hi Jan,
I uploaded in server.Files are there in respective locations...i tried with multiple syntax.those are as follows
<iframe frameborder="0" src="@(video.GetPropertyValue<string>("umbracoFile"))"></iframe> --- not supported
It shows message as 'The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.'
<source src="@(video.GetPropertyValue<string>("umbracoFile"))" type="video/mp4">
For this, mp3 file is showed....
Hi,
I want to show videos in .flv, .wmv, .mp4, .swf formats. I can upload all formats of videos. But how can I display those videos in page. I need code for that..Before that, I need to whether it is possible or not ?
Hi Thomas
It is possible to show these videos. But depending on what devices you need to target you should know that you will most likely need the same video to be available in more formats to serve the broadest range of devices possible.
Ok, so in order to be able to have the videos displayed you need to
1: Fetch the path for the desired video (Razor) 2: Some
<video>
markup 3: Perhaps a JavasSript library to add some player actions like videojs for instance http://www.videojs.com/The code you showed me above - Is that your full code? If not then please paste the full code. It makes it much easier to point things out you should correct etc.
/Jan
Hi Jan,
I need to know how to fetch the video path from media section through razor..My code is below
@{var mediaFolderId = (int)CurrentPage.VideoMediaFolder; }
@if (mediaFolderId > 0)
{
var mediaFolder = Umbraco.TypedMedia(mediaFolderId);
var videos = mediaFolder.Children(x => x.DocumentTypeAlias == "File").ToList();
var count = 0;
foreach (var video in videos)
{
<div class="col-md-6 videosize">
<div class="col-md-8">
<div style="margin: 0 auto;text-align:center;" class="flex-video1 widescreen1">
<iframe frameborder="0" width="200" height="200" src="@(video.GetPropertyValue<string>("umbracoFile"))"></iframe>
</div>
</div>
<div class="col-md-4">
<h3>@(video.GetPropertyValue<string>("videotitle")) </h3>
<p>@(video.GetPropertyValue<string>("videodescription")) </p>
</div>
<div>
<video width="320" height="240" controls>
<source src="@(video.GetPropertyValue<string>("umbracoFile"))" type="video/mp4">
</video>
</div>
</div>
}
}
Hi Jan,
What is the razor syntax for fetching the video from media section ? I used "iframe" and "video" tags as posted in last reply..
Hi Thomas
Thanks for the code - I hope i'll have some time to have a closer look during the weekend. Don't have time to do it today. So unless someone else beats me to it I can't provide an example before sunday.
But you should not use "iframe" for embedding videos. It's the
<video>
tag you need HTML wise./Jan
Hi Jan,
Do u have any example for this ?
Hi Thomas
Sorry for the late reply - I fogot about it yesterday.
But below you can see my working code
In the above it seems like you're mixing up dynamics and strongly typed. My example is based on dynamics.
For each video you need to have some fallback options since browsers support different formats. This articles does a good job of explaining this http://diveintohtml5.info/video.html
So to be covered fully you'll need the same video in the .ogg, .mp4 and .webm formats.
I hope this helps.
/Jan
Hi Jan,
Now it is working for the formats what u mentioned. Thanks for the help.
Hi Thomas
Happy to hear that it worked out - Remember to mark the post that solved your issue as the solution.
Happy coding!
/Jan
I can't seem to upload MP4 videos into the media section at all. I followed that link and increased the upload size in the web.config, but I'm still only seeing this error:
The mimetypes are also in the web.config, so I don't know what's wrong. Is something messed up with my Umbraco installation since it's giving a 404? Uploading images are fine. I've been uploading JPGs and PNGs for a while now.
is working on a reply...