HTML5 (video) background, large video, responsive layout, perfect support

Source: Internet
Author: User

HTML5 (video) background, large video, responsive layout, perfect support

First, here we know Yes

<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + PC9wPgo8cHJlIGNsYXNzPQ = "brush: java;"> <script src = "video. js" type = "text/javascript" charset = "UTF-8"> script>

Then, you will add some Javascript to trigger VideoJS when your webpage is loaded into the page. This is the header that can be done, or in a separate JavaScript file, as long as it is included in the VideoJS library after running. There is also a number option that can be set, including triggering VideoJS with other methods, which allows you to store a reference player ??, You can visit the jQuery plug-in later. Check options and setting methods, including the latest players ?? The list of readme files is up.
Copy the content to the clipboard using JavaScript Code
// Add VideoJS to all video tags on the page when the DOM is ready
VideoJS. setupAllWhenReady ();
Finally, embed your video path and player into your code.

         
          
          
                  
                                Object> video>
Later, I learned how to try and found that the problem could not be solved. It was silly to be a good master. So I finally thought of a client device detection and a round of judgment, downgrade part of the content. The original media query later found that the background video cannot be played after the pc user reduced the screen, which is not required, therefore, it is necessary to turn the header for detection;

The detection is as follows:

  var isMobile = {      Android: function() {          return navigator.userAgent.match(/Android/i) ? true : false;      },      BlackBerry: function() {          return navigator.userAgent.match(/BlackBerry/i) ? true : false;      },      iOS: function() {          return navigator.userAgent.match(/iPhone|iPad|iPod/i) ? true : false;      },      Windows: function() {          return navigator.userAgent.match(/IEMobile/i)? true : false;      },      any: function() {          return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());      }  };      if(isMobile.any())     {         $("#bgvid").hide();                          }  



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.