Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to embed video in iframe
    primarykey
    data
    text
    <p>Using HTML5 Video Support is pretty amazing but doesn't work in IE versions, So i didn't prefer it.</p> <p>I am using MVC4 Razor View engine for development.</p> <p>I came up with this issue-</p> <p>While i embed video directly from youtube then it is working fine. But when i upload a video and then show it through <code>@Model.FilePath</code> then it is not even showing iframe there. The path is correct.</p> <p><strong>Controller-</strong></p> <pre><code>[HttpPost] public ActionResult Index(HttpPostedFileBase file, SystemUser user) { if (file != null &amp;&amp; file.ContentLength &gt; 0) { string path = Server.MapPath("~/Logo/"); file.SaveAs(path + file.FileName); string filePath = "/Logo/" + Path.GetFileName(file.FileName); string Extension = Path.GetExtension(file.FileName); var scope = (from u in dv.SystemUsers where u.UserId == this.LoggedInUser.UserId select u).FirstOrDefault(); scope.FilePath = filePath; scope.FileName = file.FileName; dv.SystemUsers.GetModifiedMembers(scope); dv.SubmitChanges(); return RedirectToAction("userprofile", "User"); } return View(); } </code></pre> <p><strong>View-</strong></p> <pre><code>@model MvcApplication8.Models.SystemUser &lt;h2&gt; UserProfile&lt;/h2&gt; &lt;iframe width="560" height="315" src="@Model.FilePath" frameborder="0" &gt;&lt;/iframe&gt; </code></pre> <p><strong>FilePath-</strong></p> <pre><code>/Logo/video-2012-12-08-21-31-56.mp4 </code></pre> <p>While working with images instead of video using <code>&lt;img src="@Model.FilePath"&gt;</code> it was working excellent.</p> <p>What went wrong with iframe embedding?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload