Results 1 to 3 of 3

Thread: Having trouble Embedding a Video..HELP!

  1. #1
    Join Date
    Apr 2013

    Having trouble Embedding a Video..HELP!

    Hi guys and gals, I'm new here so bare with me:

    I'm having some trouble embedding a video on a site and so far this is how my testing has gone:

    1.) It works on my local server for these browsers: Safari, Chrome, Firefox.... Except for IE9
    2.) On a remote server (Godady/Windows server running IIS 7.0)... the video works good with Safari ...but none of the other browsers.

    Here is my css/html code:

    <video width="900" height="820" autoplay="true">
    <source src="video/video.mp4" type="video/mp4">
    <source src="video/video.ogv" type="video/ogg">
    <source src="video/video.webm" type="video/webm">
    <source src="video/video.flv" type="video/x-flv">

    I recognized that some of the file types were not recognized as I saw an error message saying this, so I figured I needed to add new MIME types as I didn't see ogg, webm, mp4 video (just mp4 audio) on the list.

    Godaddy doesn't seem to have an editable web.config file (which they confirmed), so I attempted to create one as they suggested. I saved it as web.config.xml (is this right?),
    and this is what I added:

    <?xml version="1.0" encoding="utf-8" ?>
    <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
    <mimeMap fileExtension=".ogv" mimeType="video/ogg" />
    <mimeMap fileExtension=".flv" mimeType="video/x-flv" />
    <mimeMap fileExtension=".webm" mimeType="video/webm" />

    But I'm still not getting video for the other browsers, except for Safari even with the web.config additions.

    Can anyone see anything wrong with my code? Or better yet, add suggestions that they've used that worked? Any clues would help.

    Note: I saved the mp4 as an h.264 compressed file, as some browser can only handle this type for the mp4. Do I need additional code to make this work on Firefox, Chrome, IE?

    Thanks in advance for your help.

  2. #2
    Join Date
    Mar 2011
    You might have more luck by adding some "AddType" instructions to your .htaccess file.
    AddType video/mp4 .mp4
    AddType video/ogg .ogv
    AddType video/x-flv .flv
    AddType video/webm .webm
    Rick Trethewey
    Rainbo Design

  3. #3
    Join Date
    Apr 2013
    Thanks for the reply. Appreciate the effort to help.

    I was able to solve the problem and here's what I did for the web.config:

    1.) web.config is for Windows servers (.htacess for Linux servers). Only use web.config if your server is a Windows server, and it must be saved with no extensions (no xml, txt. etc.). Once you upload it, the server will automatically know that it is a CONFIG file.

    Here is what I did to write the entire CONFIG file (web.config):

    <?xml version="1.0" encoding="utf-8" ?>
    <remove fileExtension=".mp4" />
    <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
    <mimeMap fileExtension=".ogv" mimeType="video/ogg" />
    <mimeMap fileExtension=".webm" mimeType="video/webm" />


    Here's what's going on in the above code:

    Between the "staticContent" tag... is where you can remove and add new MIME types.

    See this: <remove fileExtension=".mp4" />

    The above code removes the file extension that was there as a default mp4 file type the server had preconfigured that was not compatible for my mp4 h.264 video format. It was an "audio" version of the mp4 format, and it didn't really quite work well especially for IE9 browser for whatever reason. Check your server to see what type of mp4 format the server handles.....

    Underneath that code is the new mp4 MIME type you want to replace the old mp4 format with. The server is dumb.... so you have to tell it to take away (remove) the old format that currently exists already and replace it with that new one. It won't just do an override automatically (as I had thought), so that's why that <remove...> tag is absolutely necessary.

    Below that is the two new MIME types I added that was NOT on the server MIME type list (which I found very odd):

    <mimeMap fileExtension=".ogv" mimeType="video/ogg" />
    <mimeMap fileExtension=".webm" mimeType="video/webm" />

    So in other words, you can add as much new MIME file types as long as it's NOT currently existing on the server, so you have to see what's there first. If it is but it's somehow a different version of the file format that's needed (like the mp4 audio one I mentioned)...you MUST use that <remove fileExt.....> tag first, then add the new MIME type right underneath it.

    Then all the closing tags should follow as seen in the sample above.... That's it.

    Note: Sometimes the <system.webServer> tag works as <system.web> for certain server config setup but for me <system.web> tag didn't work. So try it out each one to see which one works and which one doesn't.

    As for my CSS/HTML to actually embed the video (which works just fine for me):

    <video id="movie" autoplay="true">
    <source src="video/myvid.mp4" type="video/mp4" />
    <source src="video/myvid.ogv" type="video/ogg" />
    <source src="video/myvid.webm" type="video/webm" />

    Please note...that my video has no controls as it's invisible since I took out the controls="true" in the upper <video...> tag. To add back controls just add that code.

    And you don't add Flash video using the video tag as I understand... you must still use the <object> tag to embed that flash file, which I don't have demonstrated here as I'm just using three types (mp4, ogg, webm).

    I hope this helps someone who can't seem to get the video to show up right on the web as it could be a server side issue, not necessarily your css/html.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.10847 seconds
  • Memory Usage 2,863KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (3)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates