Windows.  Viruses.  Notebooks.  Internet.  office.  Utilities.  Drivers

Large videos in the background of websites are a fairly popular trend in web design. Skillfully applied videos can make a website more dramatic and attractive to users.

In addition, video backgrounds can be played smoothly and without "brakes" unlike backgrounds created with JavaScript which require certain code and images to be loaded before the user sees the result of the animation.

There are companies like Powerhouse or Adidas that use video as a backdrop to a site to convey a specific message or story about a product or service to the user.

While the most popular way to create a video background is to use the HTML5 video tag along with some css options, you should also pay attention to alternative video sources, such as YouTube. In this case, you don't have to worry about a slow server response because the request will go straight to YouTube.

In this article, I'll show you how you can build a cool website that uses a YouTube video as a background. We will be using jQuery.mb.YTPlayer.js to edit and control the appearance of our video. So let's get started!

Download sources
Demo

You will need:

//Big Background Content here //About Section Content here //Small Background Section Content here

Now you need to fill each section with content. In the big-background and small-background-sections, place the pattern class to create a light texture on our video. You also need to add h1, h2, paragraph and button.

YOUTUBE VIDEO IN THE BACKGROUND I want to learn how to put any YouTube video in the background of the site

Wondering how to add video to the background of your website?
It's easier than ever! With jQuery MB.YTPlayer, a jQuery plugin, you can embed any YouTube video in the background of your site.
You can easily turn any video into HTML background. No delays in page loading and server load!

Download plugin now in social networks

I've used Font Awesome for the social icons in the small-background-section . We will then add a template for our video using the jQuery.mb.YTPlayer plugin. Place the following code immediately after the .

Here's what we used to set up the video:

  • class player - this class is used by the mb.YTPlayer plugin
  • videoURL - link to the video
  • containment- CSS selector in which to play the video
  • autoPlay - auto-play video
  • mute - the presence of sound
  • startAt - the time from which you want to start playing the video
  • opacity - video transparency
CSS Let's add styles to our site. First of all, let's define appearance html, body, paragraph tags and bulleted list.

Html ( height:100% ) body ( font:15px/23px "Raleway",sans-serif; margin:0; padding:0; height:100%; width:100%; -webkit-font-smoothing:antialiased; - webkit-text-size-adjust:100% ) p ( font-size:20px; line-height:140%; text-align:center ) ul li ( display:inline-block; list-style:none; padding-right : 10px; )

Wrapper ( z-index:600; position:relative ) .pattern ( background-image:url(../images/pattern.png); background-repeat: repeat; background-attachment:scroll; width:100%; height: 100%; position:absolute; top:0; left:0 ) .divider ( background-image:url(../images/divider.png); display:block; width:300px; height:35px; margin:10px auto ) #colorize ( color:#f1c40f; font-family:"Lato",sans-serif; font-size:40px )

It's time to style the big-background section. Set z-index to 550 and overflow to hidden. This is necessary to prevent YouTube content (subtitles, annotations) from being displayed on our website. The rest of the styles are for the headers, buttons, and the default image (more on that later).

Big-background ( z-index:550; text-align:center; height:100%; min-height:100%; position:relative; overflow:hidden ) .big-background .big-background-container ( width:830px ; max-width:100%; display:inline-block; position:absolute; top:50%; left:50%; -webkit-transform:translate(-50%,-50%); -moz-transform:translate (-50%,-50%); -ms-transform:translate(-50%,-50%); -o-transform:translate(-50%,-50%); transform:translate(-50%, -50%) ) .big-background-title ( font-family:"Raleway",sans-serif; font-size:78px; color:#fff; font-weight:300; text-transform:uppercase; text-align :center; margin-bottom:22px; padding-top:20px; display:inline-block; background-attachment:scroll; background-repeat:repeat-x; background-position:top center ) font-family:"Lato",sans-serif; font-size:13px; text-transform:uppercase; text-decoration:none; color:#fff; background:transparent; border:2px solid #fff; padding:10px 14px ; cursor:pointer; letter-spacing:2px; text-align:center; display:inline-block; -webkit-transition:.4s background ease; -moz-transition:.4s background ease; -o-transition:.4s background ease; transition:.4s background ease; ) .big-background-btn:hover ( color:#fff; background:rgba(255,255,255,0.20) ) .big-background-default-image ( background:url(../images/sunset.jpg); background-repeat :no-repeat; background-position:center center; background-size:cover; width:100%; height:100%; z-index:0; backface-visibility:hidden )

Now let's move on to the about-section . Set the background-color to white and padding to 60px top and bottom and 20px left and right.

About-section ( font-family:"Lato",sans-serif; color:#7f8c8d; background:#fff; padding:60px 20px ) .about-section-container ( text-align:center; padding-bottom:50px ) .about-section-title ( font-family:"Raleway",sans-serif; font-size:40px; background:#fff; color:#3d566e; padding:0 35px; margin-bottom:22px; background-attachment: scroll; background-repeat:repeat-x; background-position:center center; text-transform:uppercase ) a.about-section-btn ( font-family:"Lato",sans-serif; font-size:13px; text -transform:uppercase; text-decoration:none; color:#34495e; background:transparent; border:2px solid #34495e; padding:10px 14px; cursor:pointer; letter-spacing:2px; text-align:center; display: inline-block; -webkit-transition:.4s background ease; -moz-transition:.4s background ease; -o-transition:.4s background ease; transition:.4s background ease; ) .about-section-btn:hover ( color:#ffff; background: #34495e; )

For the small-background-section, which also serves as a footer, we'll set the width to 100% and the overflow to hidden. We'll also add some padding on the top and bottom to make our video visible. Finally, let's add styles for the social media buttons.

Small-background-section ( font-family:"Raleway",sans-serif; padding:100px 0; position:relative; width:100%; overflow:hidden ) .small-background-container ( position:relative; text-align :center ) .small-background-title ( font-size:40px; color:#f1c40f; font-weight:300; z-index:10; display:inline-block; text-transform:uppercase; margin-bottom:20px ; margin-top: 20px; position:relative; background-attachment:scroll; background-repeat:repeat-x; background-position:top center ) .socials a ( color:#fff ) .socials a:hover ( color:# bdc3c7)

Media queries In order for our site to be adaptive, let's add some media queries.

@media screen and (max-width: 768px) ( .about-section-title ( line-height:1 ) ) @media screen and (max-width: 480px) ( .big-background-title ( font-size:58px ) .small-background-title ( line-height:1 ) /*.player( display: none;) -> If you want to remove the video bg on a specific viewport w/o plugin*/ ) @media screen and ( max-width: 360px) ( .big-background-title,#colorize ( line-height:1 ) ) @media screen and (max-width: 320px) ( .small-background-title ( font-size:30px ) )

jQuery Now let's include our YouTube video. Let's call the player class inside jQuery code. Place the following code before the closing body tag and inside the tags.
$(function()( $(".player").mb_YTPlayer(); )); Fallback YouTube background video won't play on mobile devices oh and tablets, as YouTube rules don't allow it.

However, we can use jQuery to add background image by default, if the browser determines that the user accessed the site from a mobile device.

Manual solution

To determine if the user is logged in from a mobile or tablet device, we can hide the element at a specific screen size. For example, we want to remove the video background on screens that are 480px wide. You just need to add display: none to the player element:

@media screen and (max-width: 480px) ( .player( display: none; ) )

As far as jQuery is concerned, here we will set the is_mobile variable to false. Next, make sure the player class has a display: none parameter. If so, then add the big-background-default-image class to the big-background and small-background-sections to use the default background image. Otherwise, nothing will change.

(function($) ( $(document).ready(function() ( var is_mobile = false; if($(".player").css("display")=="none") ( is_mobile = true; ) if (is_mobile == true) ( ​​//Conditional script here $(".big-background, .small-background-section").addClass("big-background-default-image"); )else( $(". player").mb_YTPlayer(); ) )); ))(jQuery);

The jQuery plugin solution Another way to set the default image is with the device.js jQuery plugin (http://matthewhudson.me/projects/device.js/). This will simplify the process of describing conditions for different screen sizes of mobile devices. Using this plugin, we can simply write the following code:

(function($) ( $(document).ready(function() ( //Device.js will check if it is Tablet or Mobile - http://matthewhudson.me/projects/device.js/ if (!device. tablet() && !device.mobile()) ( $(".player").mb_YTPlayer(); ) else ( //jQuery will add the default background to the preferred class $(".big-background, .small- background-section").addClass("big-background-default-image"); ) )); ))(jQuery);

Here I used the device.mobile() and device.tablet() methods to check the device the user is logged in from. If the condition is met, that adds the big-background-default-image class to the big-background and small-background-section sections. Otherwise, the player class will remain unchanged and the video will play.

Tidying Up Video is a great way to get a message across to an audience. It can be a powerful tool for your website if used correctly.

I am sure that as web design develops and improves, more and more creative ideas for using video in website design will emerge. I hope you have learned something in this tutorial. Write your thoughts and comments in the comments.

From a translator. With all the wishes and comments regarding the translation, please contact me in a personal. Thank you!

| 16.04.2015

Over the past year, web designers have increasingly begun to use an original way to spice up a site - installing a video as a page background. An interesting plot or just a “live” picture on the background will decorate even an ordinary business card site, interest the user and encourage them to stay longer on the site. Today we will share with you one of the ways to set a fullscreen video background for a website using HTML5 and CSS.

If you are firmly convinced that you want to set a video for the background on the site, you need to know some nuances:

  • First, you must remember that the video has a fairly large weight. This can negatively affect page loading speed, especially if the user has a slow Internet connection. Therefore, choose videos that are not too long in time. In the case where you want to use a rather long video, be prepared to either work on reducing its weight, or that you have to sacrifice part of the audience.
  • Secondly, avoid auto-play audio from videos. Use either videos without audio, or add the ability for the user to turn on the sound himself if he needs it. Automatically playing a sound when opening a site is considered very bad form.
  • Thirdly, you need to take care of cross-browser compatibility and the correct display and playback of video on all devices, as well as provide an alternative to the video (in cases where it does not play). We will show how to do this in our example below.
  • And fourthly, you should think carefully about whether a videophone is appropriate on the site where you want to install it, since it is very easy to cross the line between originality and uselessness of this undertaking. In no case should the video distract the user from his main goal, due to which he came to the site. When setting a video background below text content, don't forget to check how readable the text is. For example, it can blend into the background in certain moment video playback (white text on a white background, black on black, etc.).
  • 1.HTML

    For our example, we took a video with a resolution of 1920 × 1080, a duration of 15 seconds and a weight of just over 3 MB. Inside the block with the identifier video-bg is our background:

    The tag has the following attributes:

    • width - the width of the area for playing the video;
    • height - the height of the area;
    • autoplay - automatic video playback;
    • loop - cyclic repetition of the video;
    • poster is an image that is displayed in place of the video while it is loading or not available.

    Next, we have two tags written, where the URLs of the video in different formats are indicated - MP4 and WEBM. Why include a video in multiple formats? The fact is that not all browsers support a single video format. So that everyone can recognize the video modern browsers, you must provide a file in at least these two formats. And the type attribute with the appropriate values ​​helps the browser to make a choice faster.

    2. CSS

    Our background stylesheet looks like this:

    #video-bg ( position: fixed; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; z-index: 1; background: url(bg/daisy-stock-poster.jpg) no -repeat #94a233; background-size: cover; ) #video-bg > video ( position: absolute; top: 0; left: 0; min-width: 100%; min-height: 100%; width: auto; height : auto; ) @supports (object-fit: cover) ( #video-bg > video ( top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; ) )

    As you can see from the code, the background is set to the entire page, and the image (a frame from the same video) is set as a backup background. In the most extreme case, the background color will be #94a233 .

    There is also an @supports directive in the code that checks if the browser supports the object-fit property. If yes, then the background is set to cover and is proportionally displayed at different screen sizes.

    According to caniuse.com, the object-fit property is currently supported by all browsers except Internet Explorer, Firefox 31-35, safari 7, iOS Safari 7.1 and Android Browser 4.1-4.4.

    Note.

    The user interface in Dreamweaver CC and later has been simplified. As a result, some of the features described in this article may not be available in Dreamweaver CC and later. See this article for more information.

    About web applications

    A web application is a website that hosts pages with partially or completely raw content. The final content is generated only after the site visitor requests the page from the web server. Due to the fact that the final content of the page depends on the request created based on the actions of the visitor, such a page is called dynamic.

    The spectrum of use of web applications is very wide. This section covers general usage of web applications and provides an example of a simple web application.

    Typical application of web applications

    The use of web applications brings certain benefits to both website visitors and website developers.

      Web applications allow visitors to quickly and easily find the information they need on information-rich websites.

      This kind of web application allows you to search content, organize content, and navigate it in a way that is convenient for your visitors. Examples of such applications are the internal networks of companies - Microsoft MSDN (www.msdn.microsoft.com) and Amazon.com (www.amazon.com).

      Web applications allow you to collect, store and analyze data received from site visitors.

      For a long time, the method used was to send data entered into HTML forms for processing by CGI applications or designated workers in the form of email messages. The web application allows you to store data directly in the database, as well as receive data and generate reports based on the received data for analysis. Examples include interactive banking pages, inventory control pages, case studies and surveys, and forms for feedback with users.

      The web application can be used to update websites with periodically changing content.

      The web application frees the web designer from the routine work of constantly updating the site's HTML pages. Content providers, such as news editors, are responsible for fresh content, while the web application monitors automatic update site. Examples include the web version of The Economist (www.economist.com) and the CNN news service (www.cnn.com).

    Sample web application

    Svetlana works as a web designer and already for a long time uses Dreamweaver in his work. Her responsibilities include maintaining the internal corporate website and the Internet site of a medium-sized company with about 1,000 employees. One day, an employee of the personnel department, Sergey, turned to her with his problem. The Human Resources Department oversees the employee wellness program. As part of this program, employees are awarded special points for every kilometer covered by walking, running or cycling. At the end of the month, each employee sends a report by e-mail to Sergey indicating the total number of kilometers. After that, Sergey, based on the obtained electronic messages rewards employees with small cash prizes depending on the points scored.

    The problem is that the wellness program has become very popular. IN this moment the number of participants in this program has grown to such an extent that at the end of the month Sergey does not have time to process all the email. Therefore, he turned to Svetlana with a question about the possibility of solving this problem using web technologies.

    In response to this, Svetlana suggested creating a web application that would solve the following tasks.

      Employees will enter data on their sporting achievements into a simple HTML form.

      The received data will be stored in the database.

      Points will be awarded based on the data received.

      Each employee can receive data on their results.

      At the end of each month, Sergey has the opportunity to get all the final results.

      In the shortest possible time, Svetlana created and launched the required application, since Dreamweaver has everything necessary tools for fast and simple creation this kind of applications.

    Any web application is a set of static and dynamic web pages. Static web page- this is a page that is always displayed in front of the user unchanged. The web server sends the page as requested by the web browser without any modification. In contrast, the server makes changes to dynamic web page before sending it to the browser. Because the page changes, it is called dynamic.

    For example, you can create a page that displays the results of a wellness program. In this case, some information (for example, the name of the employee and his results) will be determined at the time the page is requested by the employee.

    The next section discusses how web applications work in more detail.

    Handling Static Web Pages

    A static website contains a set of related HTML pages and files hosted on the computer where the web server is installed.

    The web server is software A that provides web pages in response to requests from web browsers. Typically, a page request is created when you click a link on a web page, select a bookmark in your browser, or enter a URL in address bar browser.

    The final content of a static web page is determined by the developer and remains unchanged during the page request process. Example:

    Trio Motors Information Page About Trio Motors

    All HTML code is created by the developer before the page is hosted on the server. Since the HTML code does not change after the page is posted on the server, this page is called static.

    Note.

    Strictly speaking, a "static" page may not actually be one. For example, a placeholder image or Flash content (in the form of a SWF file) can bring a static page to life. However, in this context, the page is static, as it is sent to the browser unchanged.

    When a web server receives a request to serve a static page, after parsing the request, the server finds the required page and sends it to the browser, as shown below.


    A. The web browser requests a static page. B. The web server finds the page. C. The web server sends the page to the browser that requested it.

    In the case of web applications, some sections of the page code are missing until the page is requested by a visitor. The missing code is generated by some mechanism, and only after that the page can be sent to the browser. This code generation mechanism is discussed in the next section.

    When a web server receives a request for a static web page, it sends the page directly to the browser. However, when a dynamic page is requested, the actions of the web server are not so straightforward. The server sends the page special program, which forms the final page. Such a program is called an application server.

    The application server reads the code on the page, renders the final page based on the code it read, and then removes it from the page. As a result of all these operations, a static page is obtained, which is transmitted to the web server, which in turn sends it to the client browser. All pages that the browser receives contain only HTML code. Schematic representation of the process:


    A.B.C. The application server looks at the page for instructions and performs its creation. D. The application server returns the rendered page to the web server. E.

    Storing content in a database separates the look and feel of a website from the content that users will see. Instead of creating all pages as separate HTML files, only page templates are written for each type of information to be presented. The content is then loaded into the database, after which the website will retrieve it when users request it. In addition, you can update information in one source and replicate that change across the entire website without manually editing each page. Adobe Dreamweaver allows you to create web forms for inserting, updating, and deleting information in a database.

    The program instruction for retrieving data from a database is called database query. A query consists of search criteria expressed using a database language called SQL (Structured Query Language). The text of the SQL query is located in page scripts on the server side or in tags.

    The application server cannot directly retrieve data from the database, because databases use specific formats for storing data, as a result of which an attempt to obtain such data will resemble an attempt to open a document Microsoft Word by using text editor Notepad or BBEdit. Therefore, the application server uses an intermediary, the database driver, to connect to the database. The database driver is a software module that establishes communication between the application server and the database.

    After the driver establishes a connection, a query is made to the database, as a result of which a set of records is formed. Recordset is a set of data retrieved from one or more database tables. The recordset is returned to the application server, which uses the received data to form the page.

    The following is an example of a simple SQL database query.

    SELECT lastname, firstname, fitpoints FROM employees

    The following example demonstrates the process of making a database query and returning the resulting data to the browser.



    A. The web browser requests a dynamic page. B. The web server finds the page and passes it to the application server. C. The application server looks at the page for instructions and prepares it. D. The application server sends a request to the database driver. E. The driver executes a query against the database. F. A record set is returned to the driver. G. The driver passes the recordset to the application server. H. The application server inserts the data into the page and passes the page to the web server. I. The web server sends the rendered page to the browser that requested it.

    Any database is suitable for use in a web application, as long as the appropriate database driver is installed on the server.

    To create low-budget applications, you can use a file-based database, such as a database created with Microsoft Access. If you plan to create reliable enterprise applications, it is recommended to use a back-end database, for example, based on Microsoft servers SQL Server, Oracle 9i or MySQL.

    If the database and web server are located on different computers, you should ensure a high-speed connection between systems, since the efficiency and speed of the entire web application will depend on this.

    Development of dynamic pages

    The process of developing dynamic pages consists of writing basic HTML code and then creating server-side scripts or HTML page tags that make the page dynamic. Looking at the final code, you can see that the scripting language is embedded in the page's HTML code. Accordingly, such scripting languages ​​are called HTML-embedded languages. The following example uses ColdFusion Markup Language (CFML).

    Note. Dreamweaver CC and later does not support CFML.

    Trio Motors Information Page About Trio Motors

    Trio Motors is a leading automobile manufacturer.

    Be sure to visit our #department# page.

    The instructions embedded in this page do the following:

    A variable is created with the name department, after which it is assigned the string value "Sales" .

    The value "Sales" is placed in the HTML code.

    The application server returns the following page to the web server:

    Trio Motors Information Page About Trio Motors

    Trio Motors is a leading automobile manufacturer.

    Be sure to visit our Sales page.

    The web server sends the page to the browser, which displays it as follows.

    About Trio Motors

    Trio Motors is one of the leading car manufacturers.

    Don't forget to visit our sales page.

    The choice of a scripting language or a tag-based language depends on the server technologies used. The following is a list of languages ​​that are most commonly used in server technologies supported by Dreamweaver.

    Server Technology

    ColdFusion Markup Language (CFML)

    ASP Pages

    Dreamweaver can generate the server scripts or necessary tags for the pages, or the developer can write the required code using the Dreamweaver coding environment.

    Web Application Terminology

    This section provides definitions of commonly used terms related to web applications.

    Applications server

    Software that is used by a web server to process web pages that contain server-side scripts or tags. When such pages are requested, the web server first passes them to the application server for processing, and then sends them to the client browser. For more information, see How web applications work.

    The most common application servers support ColdFusion and PHP.

    Connecting the popular Zadarma service to 1C is now a matter of a few minutes. It is enough to connect a ready-made extension for the integration of 1C and Zadarma. Any employee can perform the installation without any problems, even the cleaner Aunt Masha, a cleaning specialist.

    First of all, we focused on small businesses that actively use the Zadarma PBX and the 1C: Small Business Management 1.6 configuration.

    As it was before

    To integrate with Zadarma, you had to use a special dialer built into 1C - the so-called SIP background. This option was suitable, with several "ifs":

    • if 1C is set to local computer, not somewhere on the terminal server
    • if the user agrees to use a 1C dialer instead of a desktop phone

    In general, if all “ifs” agreed, then integration was possible.

    How has it become now

    Now, for the integration of 1C and Zadarma, it does not matter at all which end device is used for calls. It could be anything:

    • desk phone
    • softphone installed in OS
    • web background running in browser

    The 1C extension for Zadarma interacts with the API, not with the dialer. Therefore, it does not matter what exactly the user will call.

    Easy to install

    Installation consists of 1 step. Just show you 2 screenshots.

    Home page placement

    The Zadarma telephony panel automatically appears on the home page. If suddenly the user does not need this, then he can simply uncheck the menu "View" - "Setting the initial page".

    Ease of setup

    Get API keys from personal account Zadarma

    and insert them into 1C

    And of course, we enter the username / password of the account on simplit.io.

    That's it, now your 1C is connected to Zadarma.

    Calls on click in 1C

    Wherever we see the “phone” icon, you can click on it and Zadarma will start dialing.

    Details "Contact information" are in many lists of documents, directories - you no longer need to run to the client card to call. For example, you can call directly from the list of orders, invoices, expenses

    customer card at incoming call

    A function that has actually become standard and mandatory when integrating 1C and PBX. Although it should be noted that it is far from always in demand, therefore, it can be turned off in the Telephony Panel settings.

    Registering a call with an Event document

    Similarly, you can manage the need automatic creation document "Event- Phone call". With the help of this document, it is convenient to leave comments on the call.

    And most importantly, on the basis of this document, you can then enter the Order, Invoice, and thus the relationship between the call and the sale will be clearly visible.

    You can attach a reminder to the Phone call document, which is very convenient if the employee promised to call the client back later.

    PBX call history

    Call history is, of course, a very important thing. The extension for integrating 1C and Zadarma provides several options for working with history.

    For example, a user wants to view history by himself. Similar to the list of recent calls in our cell phone. This history can be viewed by opening the "History" tab on the home page.

    Very often you want to see the history of a specific client, contact person or to an individual. In the case of a client, we need to see both calls to the numbers of the counterparty itself and to the numbers of all his contact persons.

    The history of calls with selection by client can be viewed directly in his card. The history includes calls from the client and all his contacts. When the number belongs to the counterparty himself, the "Contact" field is not filled.

    If you notice an error, select a piece of text and press Ctrl + Enter
    SHARE: