New in JW Player: Responsive Design

Blog 3 min read | May 3, 2013 | JW Player

Share:

With sales of mobile devices now outpacing those of desktop PCs, web designers face a challenge: how to best present content across all these devices. Smartphone screens average around 4” diagonally, tablets are 7″ to 10″, laptops average around 14″ and desktop monitors go up to 30″ these days. All these different devices result in screens of varying shapes and sizes. This presents a challenge when laying out a page – how to provide a viewing experience that looks good on every screen. One solution is responsive design.

What is Responsive Design?

The best way to understand responsive design is to look at what happens when a page is not responsive:

As you can see, when design is not responsive, when you resize your screen, in this case the browser window, the page elements do not resize as well. The traditional way around this is to create multiple sites, one for the desktop, one for a smartphone, etc. This is not ideal, both from the point of view of the designer/developer and the end user experience.

Responsive Web Design is an approach to creating a website that dynamically adapts itself to the size of the screen on which it is being displayed. Whether you are on a tablet, smartphone or desktop, responsive pages rearrange and resize content to provide the optimal viewing experience. If you are interested in looking at a few responsive design examples, we highly recommend checking out this blog.

The Challenge with Responsive Video

While text can easily be manipulated in a responsive design, embedded video has remained a challenge. Unlike the HTML5

To be honest, it is possible to make embedded players such as earlier versions of JW6 responsive by using various CSS hacks. For instance, Elastic Videos uses iframes where the source is 100×100 pixels. FitVids is a jquery plugin that uses additional javascript libraries to achieve responsive design. As you can imagine, these are not the most elegant solutions, nor are they scalable.

Because responsive design is a current web trend used by a lot of sites, we have received many feature requests for JW Player to support it. We wanted to provide a setable option within the player to make it responsive, rather than merely a set of instructions to use JW Player with one of the existing hacks. This was a challenge because JW Player is used on so many sites across both Flash and HTML5 modes, that we had to avoid potential CSS clashes (conflicts between the CSS in the player and the existing CSS on the page).

Introducing JW Player Responsive Design

With the release of JW Player 6.4, we introduced native support for responsive design. To get started, all you have to do is set the player width to a percentage, and indicate the video’s aspect ratio. The player will automatically resize its height accordingly.

JW Player Setup Code

The responsive player setup options for this demo are displayed below. To learn more about embedding JW Player, check out our support documentation.

jwplayer("myResponsiveVideo").setup({
file: "/assets/tearsofsteel.mp4",
image: "/assets/tearsofsteel.jpg",
width: "100%",
aspectratio: "12:5"
});

WordPress Setup Options

Our WordPress Plugin version 2.1 makes it even easier to setup JW Player with Responsive design. In the JW Player management section, simply set the player dimensions to responsive:

Check out this demo to test out a responsive vs a non-responsive JW Player. If you have questions on this functionality, or ideas for future updates, please let us know!