{"id":418,"date":"2013-04-02T21:52:19","date_gmt":"2013-04-02T20:52:19","guid":{"rendered":"http:\/\/powered-by-haiku.co.uk\/?page_id=418"},"modified":"2013-04-22T19:08:58","modified_gmt":"2013-04-22T18:08:58","slug":"multiple-quality-levels-jw5","status":"publish","type":"page","link":"https:\/\/powered-by-haiku.co.uk\/?page_id=418","title":{"rendered":"Multiple quality levels | JW5"},"content":{"rendered":"<p>\nSetting up multiple quality levels is as simple as providing additional sources for each file type, and including <code>data-bitrate<\/code> and\/or <code>data-width<\/code> parameters for each.<\/p>\n<p><strike>Additionally for JW5 we need to specify a <strong>plugin<\/strong> that that will be used to switch between the different quality levels. This is done by including the <code>div.jw-plugins<\/code> block with a specific <code>div.jw-plugin<\/code> that has it&#8217;s <code>data-type<\/code> set to <code>hd-2<\/code><\/strike><em> &#8211; This is now auto-detected and the <code>hd-2<\/code> plugin is added dynamically.<\/em><\/p>\n<p><code class=\"code-block\">&lt;div class=\"jw-settings\" id=\"my_simple_settings\"&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &lt;video id=\"my_simple_video\" poster=\"\/posters\/big-buck-bunny-preview.jpg\" preload=\"none\"&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;source src=\"\/videos\/mp4\/big-buck-bunny-360.mp4\" type=\"video\/mp4\" data-bitrate=\"555\" data-width=\"360\" \/&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;source src=\"\/videos\/mp4\/big-buck-bunny-540.mp4\" type=\"video\/mp4\" data-bitrate=\"777\" data-width=\"540\" \/&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;source src=\"\/videos\/mp4\/big-buck-bunny-720.mp4\" type=\"video\/mp4\" data-bitrate=\"999\" data-width=\"720\" \/&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/video&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &lt;div class=\"jw-modes\"&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;div class=\"jw-mode\" data-type=\"html5\"&gt;&lt;\/div&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;div class=\"jw-mode\" data-type=\"flash\" data-src=\"\/jwplayer\/v5\/player.swf\"&gt;&lt;\/div&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/div&gt;<br \/>\n<strike>&nbsp;&nbsp;&nbsp;&nbsp; &lt;div class=\"jw-plugins\"&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;div class=\"jw-plugin\" data-type=\"hd-2\">&lt;\/div&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/div&gt;<\/strike><br \/>\n&lt;\/div&gt;<br \/>\n<\/code>\n<\/p>\n<p><strong>In JW5 only the lowest and highest bitrate\/width combinations will be used to provide switching between SD and HD<\/strong><\/p>\n<p>Adding the above code to your page results in the following JW Player video with two-state quality switching:<\/p>\n<div class=\"jw-settings\" id=\"my_simple_settings\">\n   <video id=\"my_simple_video\" poster=\"http:\/\/dev.powered-by-haiku.co.uk\/jw-html-config\/posters\/big-buck-bunny-preview.jpg\" preload=\"none\"><source src=\"http:\/\/dev.powered-by-haiku.co.uk\/jw-html-config\/videos\/mp4\/big-buck-bunny.mp4\" type=\"video\/mp4\" data-bitrate=\"555\" data-width=\"360\" \/><source src=\"http:\/\/dev.powered-by-haiku.co.uk\/jw-html-config\/videos\/mp4\/big-buck-bunny.mp4\" type=\"video\/mp4\" data-bitrate=\"777\" data-width=\"540\" \/><source src=\"http:\/\/dev.powered-by-haiku.co.uk\/jw-html-config\/videos\/mp4\/big-buck-bunny.mp4\" type=\"video\/mp4\" data-bitrate=\"999\" data-width=\"720\" \/><\/video><\/p>\n<div class=\"jw-modes\">\n<div class=\"jw-mode\" data-type=\"html5\"><\/div>\n<div class=\"jw-mode\" data-type=\"flash\" data-src=\"http:\/\/dev.powered-by-haiku.co.uk\/jw-html-config\/jwplayer\/v5\/player.swf\"><\/div>\n<\/p><\/div>\n<\/div>\n<p>There are a couple of scenarios where you may wish to define multiple quality levels for a source, but not have JW HTML Config automatically load the HD plugin: <\/p>\n<ul>\n<li>You wish to use an either RTMP or HTTP bitrate switching;<\/li>\n<li>You wish to use an alternate HD solution<\/li>\n<\/ul>\n<p>In these situations it is simple to override the JW HTML Config behaviour by including the <code>div.jw-plugins<\/code> block with a specific <code>div.jw-plugin<\/code> that has it&#8217;s <code>data-type<\/code> set to <code>hd-2<\/code>, but with the additional <code>data-disabled<\/code> attribute set to <code>true<\/code>:<\/p>\n<p><code class=\"code-block\">&lt;div class=\"jw-settings\" id=\"my_simple_settings\"&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &lt;video id=\"my_simple_video\" poster=\"\/posters\/big-buck-bunny-preview.jpg\" preload=\"none\"&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;source src=\"\/videos\/mp4\/big-buck-bunny-360.mp4\" type=\"video\/mp4\" data-bitrate=\"555\" data-width=\"360\" \/&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;source src=\"\/videos\/mp4\/big-buck-bunny-540.mp4\" type=\"video\/mp4\" data-bitrate=\"777\" data-width=\"540\" \/&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;source src=\"\/videos\/mp4\/big-buck-bunny-720.mp4\" type=\"video\/mp4\" data-bitrate=\"999\" data-width=\"720\" \/&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/video&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &lt;div class=\"jw-modes\"&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;div class=\"jw-mode\" data-type=\"html5\"&gt;&lt;\/div&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;div class=\"jw-mode\" data-type=\"flash\" data-src=\"\/jwplayer\/v5\/player.swf\"&gt;&lt;\/div&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/div&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &lt;div class=\"jw-plugins\"&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;div class=\"jw-plugin\" data-type=\"hd-2\" data-disabled=\"true\">&lt;\/div&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/div&gt;<br \/>\n&lt;\/div&gt;<br \/>\n<\/code>\n<\/p>\n<p>This results in the following:<\/p>\n<div class=\"jw-settings\" id=\"my_simple_settings_no_hd\">\n   <video id=\"my_simple_video_no_hd\" poster=\"http:\/\/dev.powered-by-haiku.co.uk\/jw-html-config\/posters\/big-buck-bunny-preview.jpg\" preload=\"none\"><source src=\"http:\/\/dev.powered-by-haiku.co.uk\/jw-html-config\/videos\/mp4\/big-buck-bunny.mp4\" type=\"video\/mp4\" data-bitrate=\"555\" data-width=\"360\" \/><source src=\"http:\/\/dev.powered-by-haiku.co.uk\/jw-html-config\/videos\/mp4\/big-buck-bunny.mp4\" type=\"video\/mp4\" data-bitrate=\"777\" data-width=\"540\" \/><source src=\"http:\/\/dev.powered-by-haiku.co.uk\/jw-html-config\/videos\/mp4\/big-buck-bunny.mp4\" type=\"video\/mp4\" data-bitrate=\"999\" data-width=\"720\" \/><\/video><\/p>\n<div class=\"jw-modes\">\n<div class=\"jw-mode\" data-type=\"html5\"><\/div>\n<div class=\"jw-mode\" data-type=\"flash\" data-src=\"http:\/\/dev.powered-by-haiku.co.uk\/jw-html-config\/jwplayer\/v5\/player.swf\"><\/div>\n<\/p><\/div>\n<div class=\"jw-plugins\">\n<div class=\"jw-plugin\" data-type=\"hd-2\" data-disabled=\"true\"><\/div>\n<\/p><\/div>\n<\/div>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting up multiple quality levels is as simple as providing additional sources for each file type, and including data-bitrate and\/or data-width parameters for each. Additionally for JW5 we need to specify a plugin that that will be used to switch between the different quality levels. This is done by including the div.jw-plugins block with a&hellip; <a href=\"https:\/\/powered-by-haiku.co.uk\/?page_id=418\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":160,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-418","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/powered-by-haiku.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/powered-by-haiku.co.uk\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/powered-by-haiku.co.uk\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/powered-by-haiku.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/powered-by-haiku.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=418"}],"version-history":[{"count":27,"href":"https:\/\/powered-by-haiku.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/418\/revisions"}],"predecessor-version":[{"id":541,"href":"https:\/\/powered-by-haiku.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/418\/revisions\/541"}],"wp:attachment":[{"href":"https:\/\/powered-by-haiku.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}