locked
Embed .MP4 video in asp.net web page RRS feed

  • Question

  • User810354248 posted

    In my asp.net web page i want to embed .mp4 video. I tried various codes but they have some limitations.

       <video max-width="100%" controls autoplay muted>
        <source src="YASHODA.mp4" type="video/mp4">
        <source src="movie1.webm" type="video/webm" controls>
        Your browser does not support the video tag.
      </video>
          

    The above code plays sound only no video comes

    some other videos asks for plugin

    i am usiing this web page in local network without internet

    Thursday, September 8, 2016 3:21 PM

Answers

  • User347430248 posted

    Hi Baiju EP,

    As we already know that each bowser support the different file type of videos.

    also your requirement is to run the video on more then 3 browsers and locally.

    so I think that the easiest solution is to develop the code for particular browser and inform your users to use that particular browser to access this web page.

    as it will be access locally so you can easily provide this information to your users.

    another way is to do some Asp.net codding and check the browser when web page load in it.

    and you need to load the supported type of video to their browser. so with this approach you can try to load video in any browser without get failed.

    just you need to store your video in every file type extension.  it takes more space on the disk.

    but if there are few videos are there in your site then this work around can work for you.

    Regards

    Deepak

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 13, 2016 7:30 AM

All replies

  • User-484054684 posted

    Have you tried removing 'muted' attribute on video tag? Never mind, I thought, video comes but audio has issue. So suggested change for muted.

    Anyway, Could be issue with your video or browser or any site settings? 

    Try to play this in your browser to rule out the problems:

    http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_video

    Thursday, September 8, 2016 3:44 PM
  • User810354248 posted

    I has already tried this link and code

    I want a code by which the video should play in IE, Firefox, Chrome

    Thursday, September 8, 2016 4:41 PM
  • User810354248 posted

    I tried the below code it works in IE but not in Chrome

          <object id="mediaplayer" classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701" standby="loading microsoft windows media player components..." type="application/x-oleobject" width="320" height="310">
    <param name="filename" value="movie.mp4">
         <param name="animationatstart" value="true">
         <param name="transparentatstart" value="true">
         <param name="autostart" value="true">
         <param name="showcontrols" value="true">
         <param name="ShowStatusBar" value="true">
         <param name="windowlessvideo" value="true">
         <embed src="movie.mp4" autostart="true" showcontrols="true" showstatusbar="1" bgcolor="white" width="320" height="310">
    </object>

    I tried the below code it works in chrome but not in IE

       <video max-width="100%" controls autoplay muted>
        <source src="movie.mp4" type="video/mp4">
        <source src="movie1.webm" type="video/webm" controls>
        Your browser does not support the video tag.
      </video>

    Thursday, September 8, 2016 4:45 PM
  • User-1672470423 posted

    Can you check the approach mentioned in below links:

    https://www.dev-metal.com/crossbrowser-safe-html5-video-ie6-lines-code/

    https://github.com/panique/html5-video

    Thursday, September 8, 2016 6:17 PM
  • User810354248 posted

    Tried the links provided one of them is useful but not working in IE8 and it works in chrome. i am using this in my local network and it should work in IE and also in firefox

    Friday, September 9, 2016 2:46 PM
  • User-1672470423 posted

    Did you check by enabling IE -> Tools -> Manage add-ons -> Enable "Shockwave Flash Object"

    For Firefox Add-ons -> plugins -> Always Active "Shockwave Flash"

    For IE8, try check below link

    http://developedtraffic.com/2010/05/23/ie8-wont-install-flash-player-solution/

    Friday, September 9, 2016 3:14 PM
  • User258511753 posted

    you must write this code in web,config 

    <system.webServer>
    
        <staticContent>
          <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
          <mimeMap fileExtension=".m4v" mimeType="video/m4v" />
        </staticContent>
    
      </system.webServer>

    Sunday, September 11, 2016 2:34 PM
  • User347430248 posted

    Hi Baiju EP,

    As we already know that each bowser support the different file type of videos.

    also your requirement is to run the video on more then 3 browsers and locally.

    so I think that the easiest solution is to develop the code for particular browser and inform your users to use that particular browser to access this web page.

    as it will be access locally so you can easily provide this information to your users.

    another way is to do some Asp.net codding and check the browser when web page load in it.

    and you need to load the supported type of video to their browser. so with this approach you can try to load video in any browser without get failed.

    just you need to store your video in every file type extension.  it takes more space on the disk.

    but if there are few videos are there in your site then this work around can work for you.

    Regards

    Deepak

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 13, 2016 7:30 AM