Recherche avancée

Médias (1)

Mot : - Tags -/censure

Autres articles (82)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (4967)

  • A systematic approach to making Web Applications accessible

    22 février 2012, par silvia

    With the latest developments in HTML5 and the still fairly new ARIA (Accessible Rich Interface Applications) attributes introduced by the W3C WAI (Web Accessibility Initiative), browsers have now implemented many features that allow you to make your JavaScript-heavy Web applications accessible.

    Since I began working on making a complex web application accessible just over a year ago, I discovered that there was no step-by-step guide to approaching the changes necessary for creating an accessible Web application. Therefore, many people believe that it is still hard, if not impossible, to make Web applications accessible. In fact, it can be approached systematically, as this article will describe.

    This post is based on a talk that Alice Boxhall and I gave at the recent Linux.conf.au titled “Developing accessible Web apps – how hard can it be ?” (slides, video), which in turn was based on a Google Developer Day talk by Rachel Shearer (slides).

    These talks, and this article, introduce a process that you can follow to make your Web applications accessible : each step will take you closer to having an application that can be accessed using a keyboard alone, and by users of screenreaders and other accessibility technology (AT).

    The recommendations here only roughly conform to the requirements of WCAG (Web Content Accessibility Guidelines), which is the basis of legal accessibility requirements in many jurisdictions. The steps in this article may or may not be sufficient to meet a legal requirement. It is focused on the practical outcome of ensuring users with disabilities can use your Web application.

    Step-by-step Approach

    The steps to follow to make your Web apps accessible are as follows :

    1. Use native HTML tags wherever possible
    2. Make interactive elements keyboard accessible
    3. Provide extra markup for AT (accessibility technology)

    If you are a total newcomer to accessibility, I highly recommend installing a screenreader and just trying to read/navigate some Web pages. On Windows you can install the free NVDA screenreader, on Mac you can activate the pre-installed VoiceOver screenreader, on Linux you can use Orca, and if you just want a browser plugin for Chrome try installing ChromeVox.

    1. Use native HTML tags

    As you implement your Web application with interactive controls, try to use as many native HTML tags as possible.

    HTML5 provides a rich set of elements which can be used to both add functionality and provide semantic context to your page. HTML4 already included many useful interactive controls, like <a>, <button>, <input> and <select>, and semantic landmark elements like <h1>. HTML5 adds richer <input> controls, and a more sophisticated set of semantic markup elements like such as <time>, <progress>, <meter>, <nav>, <header>, <article> and <aside>. (Note : check browser support for browser support of the new tags).

    Using as much of the rich HTML5 markup as possible means that you get all of the accessibility features which have been implemented in the browser for those elements, such as keyboard support, short-cut keys and accessibility metadata, for free. For generic tags you have to implement them completely from scratch.

    What exactly do you miss out on when you use a generic tag such as <div> over a specific semantic one such as <button> ?

    1. Generic tags are not focusable. That means you cannot reach them through using the [tab] on the keyboard.
    2. You cannot activate them with the space bar or enter key or perform any other keyboard interaction that would be regarded as typical with such a control.
    3. Since the role that the control represents is not specified in code but is only exposed through your custom visual styling, screenreaders cannot express to their users what type of control it is, e.g. button or link.
    4. Neither can screenreaders add the control to the list of controls on the page that are of a certain type, e.g. to navigate to all headers of a certain level on the page.
    5. And finally you need to manually style the element in order for it to look distinctive compared to other elements on the page ; using a default control will allow the browser to provide the default style for the platform, which you can still override using CSS if you want.

    Example :

    Compare these two buttons. The first one is implemented using a <div> tag, the second one using a <button> tag. Try using a screenreader to experience the difference.

    Send
    <style>
     .custombutton 
      cursor : pointer ;
      border : 1px solid #000 ;
      background-color : #F6F6F6 ;
      display : inline-block ;
      padding : 2px 5px ;
    
    </style>
    <div class="custombutton" onclick="alert(’sent !’)">
      Send
    </div>
    
    <button onclick="alert(’sent !’)">
    Send
    </button>

    2. Make interactive elements keyboard accessible

    Many sophisticated web applications have some interactive controls that just have no appropriate HTML tag equivalent. In this case, you will have had to build an interactive element with JavaScript and <div> and/or <span> tags and lots of custom styling. The good news is, it’s possible to make even these custom controls accessible, and as a side benefit you will also make your application smoother to use for power users.

    The first thing you can do to test usability of your control, or your Web app, is to unplug the mouse and try to use only the [TAB] and [ENTER] keys to interact with your application.

    the tab key on the keyboardthe enter key on the keyboard

    Try the following :

    • Can you reach all interactive elements with [TAB] ?
    • Can you activate interactive elements with [ENTER] (or [SPACE]) ?
    • Are the elements in the right tab order ?
    • After interaction : is the right element in focus ?
    • Is there a keyboard shortcut that activates the element (accesskey) ?

    No ? Let’s fix it.

    2.1. Reaching interactive elements

    If you have an element on your page that cannot be reached with [TAB], put a @tabindex attribute on it.

    Example :

    Here we have a <span> tag that works as a link (don’t do this – it’s just a simple example). The first one cannot be reached using [TAB] but the second one has a tabindex and is thus part of the tab order of the HTML page.

    (Note : since we experiment lots with the tabindex in this article, to avoid confusion, click on some text in this paragraph and then hit the [TAB] key to see where it goes next. The click will set your keyboard focus in the DOM.)

    Click

    <style>
    .customlink 
      text-decoration : underline ;
      cursor : pointer ;
    
    </style>
    <span class="customlink" onclick="alert(’activated !’)">
    Click
    </span>
    
    Click
    <style>
    .customlink 
      text-decoration : underline ;
      cursor : pointer ;
    
    </style>
    <span class="customlink" onclick="alert(’activated !’)" tabindex="0">
    Click
    </span>
    

    You set @tabindex=0 to add an element into the native tab order of the page, which is the DOM order.

    2.2. Activating interactive elements

    Next, you typically want to be able to use the [ENTER] and [SPACE] keys to activate your custom control. To do so, you will need to implement an onkeydown event handler. Note that the keyCode for [ENTER] is 13 and for [SPACE] is 32.

    Example :

    Let’s add this functionality to the <span> tag from before. Try tabbing to it and hit the [ENTER] or [SPACE] key.

    Click
    <span class="customlink" onclick="alert(’activated !’)" tabindex="0">
    Click
    </span>
    
    &lt;script&gt;<br />
    function handlekey(event) {<br />
    var target = event.target || event.srcElement;<br />
    if (event.keyCode == 13 || event.keyCode == 32) { target.onclick(); }<br />
    }<br />
    &lt;/script&gt;


    Click

    <span class="customlink" onclick="alert(’activated !’)" tabindex="0"
          onkeydown="handlekey(event) ;">
    Click
    </span>
    <script>
    function handlekey(event) 
      var target = event.target || event.srcElement ;
      if (event.keyCode == 13 || event.keyCode == 32) 
        target.onclick() ;
      
    
    </script>

    Note that there are some controls that might need support for keys other than [tab] or [enter] to be able to use them from the keyboard alone, for example a custom list box, menu or slider should respond to arrow keys.

    2.3. Elements in the right tab order

    Have you tried tabbing to all the elements on your page that you care about ? If so, check if the order of tab stops seems right. The default order is given by the order in which interactive elements appear in the DOM. For example, if your page’s code has a right column that is coded before the main article, then the links in the right column will receive tab focus first before the links in the main article.

    You could change this by re-ordering your DOM, but oftentimes this is not possible. So, instead give the elements that should be the first ones to receive tab focus a positive @tabindex. The tab access will start at the smallest non-zero @tabindex value. If multiple elements share the same @tabindex value, these controls receive tab focus in DOM order. After that, interactive elements and those with @tabindex=0 will receive tab focus in DOM order.

    Example :

    The one thing that always annoys me the most is if the tab order in forms that I am supposed to fill in is illogical. Here is an example where the first and last name are separated by the address because they are in a table. We could fix it by moving to a <div> based layout, but let’s use @tabindex to demonstrate the change.

    Firstname :
    Address :
    Lastname :
    City :
    <table class="customtabs">
      <tr>
        <td>Firstname :
          <input type="text" id="firstname">
        </td>
        <td>Address :
          <input type="text" id="address">
        </td>
      </tr>
      <tr>
        <td>Lastname :
          <input type="text" id="lastname">
        </td>
        <td>City :
          <input type="text" id="city">
        </td>
      </tr>
    </table>
    
    Click here to test this form,
    then [TAB] :
    Firstname :
    Address :
    Lastname :
    City :
    <table class="customtabs">
      <tr>
        <td>Firstname :
          <input type="text" id="firstname" tabindex="10">
        </td>
        <td>Address :
          <input type="text" id="address" tabindex="30">
        </td>
      </tr>
      <tr>
        <td>Lastname :
          <input type="text" id="lastname" tabindex="20">
        </td>
        <td>City :
          <input type="text" id="city" tabindex="40">
        </td>
      </tr>
    </table>

    Be very careful with using non-zero tabindex values. Since they change the tab order on the page, you may get side effects that you might not have intended, such as having to give other elements on the page a non-zero tabindex value to avoid skipping too many other elements as I would need to do here.

    2.4. Focus on the right element

    Some of the controls that you create may be rather complex and open elements on the page that were previously hidden. This is particularly the case for drop-downs, pop-ups, and menus in general. Oftentimes the hidden element is not defined in the DOM right after the interactive control, such that a [TAB] will not put your keyboard focus on the next element that you are interacting with.

    The solution is to manage your keyboard focus from JavaScript using the .focus() method.

    Example :

    Here is a menu that is declared ahead of the menu button. If you tab onto the button and hit enter, the menu is revealed. But your tab focus is still on the menu button, so your next [TAB] will take you somewhere else. We fix it by setting the focus on the first menu item after opening the menu.

    &lt;script&gt;<br />
    function displayMenu(value) {<br />
    document.getElementById(&quot;custommenu&quot;).style.display=value;<br />
    }<br />
    &lt;/script&gt;
    <div id="custommenu" style="display:none ;">
      <button id="item1" onclick="displayMenu(’none’) ;">Menu item1</button>
      <button id="item2" onclick="displayMenu(’none’) ;">Menu item2</button>
    </div>
    <button onclick="displayMenu(’block’) ;">Menu</button>
    <script>
    function displayMenu(value) 
     document.getElementById("custommenu").style.display=value ;
    
    </script>
    
    &lt;script&gt;<br />
    function displayMenu2(value) {<br />
    document.getElementById(&quot;custommenu2&quot;).style.display=value;<br />
    document.getElementById(&quot;item1&quot;).focus();<br />
    }<br />
    &lt;/script&gt;
    <div id="custommenu" style="display:none ;">
      <button id="item1" onclick="displayMenu(’none’) ;">Menu item1</button>
      <button id="item2" onclick="displayMenu(’none’) ;">Menu item2</button>
    </div>
    <button onclick="displayMenu(’block’) ;">Menu</button>
    <script>
    function displayMenu(value) 
     document.getElementById("custommenu").style.display=value ;
     document.getElementById("item1").focus() ;
    
    </script>

    You will notice that there are still some things you can improve on here. For example, after you close the menu again with one of the menu items, the focus does not move back onto the menu button.

    Also, after opening the menu, you may prefer not to move the focus onto the first menu item but rather just onto the menu <div>. You can do so by giving that div a @tabindex and then calling .focus() on it. If you do not want to make the div part of the normal tabbing order, just give it a @tabindex=-1 value. This will allow your div to receive focus from script, but be exempt from accidental tabbing onto (though usually you just want to use @tabindex=0).

    Bonus : If you want to help keyboard users even more, you can also put outlines on the element that is currently in focus using CSS”s outline property. If you want to avoid the outlines for mouse users, you can dynamically add a class that removes the outline in mouseover events but leaves it for :focus.

    2.5. Provide sensible keyboard shortcuts

    At this stage your application is actually keyboard accessible. Congratulations !

    However, it’s still not very efficient : like power-users, screenreader users love keyboard shortcuts : can you imagine if you were forced to tab through an entire page, or navigate back to a menu tree at the top of the page, to reach each control you were interested in ? And, obviously, anything which makes navigating the app via the keyboard more efficient for screenreader users will benefit all power users as well, like the ubiquitous keyboard shortcuts for cut, copy and paste.

    HTML4 introduced so-called accesskeys for this. In HTML5 @accesskey is now allowed on all elements.

    The @accesskey attribute takes the value of a keyboard key (e.g. @accesskey="x") and is activated through platform- and browser-specific activation keys. For example, on the Mac it’s generally the [Ctrl] key, in IE it’ the [Alt] key, in Firefox on Windows [Shift]-[Alt], and in Opera on Windows [Shift]-[ESC]. You press the activation key and the accesskey together which either activates or focuses the element with the @accesskey attribute.

    Example :


    &lt;script&gt;<br />
    var button = document.getElementById('accessbutton');<br />
    if (button.accessKeyLabel) {<br />
     button.innerHTML += ' (' + button.accessKeyLabel + ')';<br />
    }<br />
    &lt;/script&gt;
    <button id="accessbutton" onclick="alert(’sent !’)" accesskey="e">
    Send
    </button>
    <script>
      var button = document.getElementById(’accessbutton’) ;
      if (button.accessKeyLabel) 
        button.innerHTML += ’ (’ + button.accessKeyLabel + ’)’ ;
      
    </script>

    Now, the idea behind this is clever, but the execution is pretty poor. Firstly, the different activation keys between different platforms and browsers make it really hard for people to get used to the accesskeys. Secondly, the key combinations can conflict with browser and screenreader shortcut keys, the first of which will render browser shortcuts unusable and the second will effectively remove the accesskeys.

    In the end it is up to the Web application developer whether to use the accesskey attribute or whether to implement explicit shortcut keys for the application through key event handlers on the window object. In either case, make sure to provide a help list for your shortcut keys.

    Also note that a page with a really good hierarchical heading layout and use of ARIA landmarks can help to eliminate the need for accesskeys to jump around the page, since there are typically default navigations available in screen readers to jump directly to headings, hyperlinks, and ARIA landmarks.

    3. Provide markup for AT

    Having made the application keyboard accessible also has advantages for screenreaders, since they can now reach the controls individually and activate them. So, next we will use a screenreader and close our eyes to find out where we only provide visual cues to understand the necessary interaction.

    Here are some of the issues to consider :

    • Role may need to get identified
    • States may need to be kept track of
    • Properties may need to be made explicit
    • Labels may need to be provided for elements

    This is where the W3C’s ARIA (Accessible Rich Internet Applications) standard comes in. ARIA attributes provide semantic information to screen readers and other AT that is otherwise conveyed only visually.

    Note that using ARIA does not automatically implement the standard widget behavior – you’ll still need to add focus management, keyboard navigation, and change aria attribute values in script.

    3.1. ARIA roles

    After implementing a custom interactive widget, you need to add a @role attribute to indicate what type of controls it is, e.g. that it is playing the role of a standard tag such as a button.

    Example :

    This menu button is implemented as a <div>, but with a role of “button” it is announced as a button by a screenreader.

    Menu
    <div tabindex="0" role="button">Menu</div>
    

    ARIA roles also describe composite controls that do not have a native HTML equivalent.

    Example :

    This menu with menu items is implemented as a set of <div> tags, but with a role of “menu” and “menuitem” items.

    <div role="menu">
      <div tabindex="0" role="menuitem">Cut</div>
      <div tabindex="0" role="menuitem">Copy</div>
      <div tabindex="0" role="menuitem">Paste</div>
    </div>
    

    3.2. ARIA states

    Some interactive controls represent different states, e.g. a checkbox can be checked or unchecked, or a menu can be expanded or collapsed.

    Example :

    The following menu has states on the menu items, which are here not just used to give an aural indication through the screenreader, but also a visual one through CSS.

    <style>
    .custombutton[aria-checked=true]:before 
       content :  "\2713 " ;
    
    </style>
    <div role="menu">
      <div tabindex="0" role="menuitem" aria-checked="true">Left</div>
      <div tabindex="0" role="menuitem" aria-checked="false">Center</div>
      <div tabindex="0" role="menuitem" aria-checked="false">Right</div>
    </div>
    

    3.3. ARIA properties

    Some of the functionality of interactive controls cannot be captured by the role attribute alone. We have ARIA properties to add features that the screenreader needs to announce, such as aria-label, aria-haspopup, aria-activedescendant, or aria-live.

    Example :

    The following drop-down menu uses aria-haspopup to tell the screenreader that there is a popup hidden behind the menu button together with an ARIA state of aria-expanded to track whether it’s open or closed.

    Justify
    &lt;script&gt;<br />
    var button = document.getElementById(&quot;button&quot;);<br />
    var menu = document.getElementById(&quot;menu&quot;);<br />
    var items = document.getElementsByClassName(&quot;menuitem&quot;);<br />
    var focused = 0;<br />
    function showMenu(evt) {<br />
       evt.stopPropagation();<br />
       menu.style.visibility = 'visible';<br />
       button.setAttribute('aria-expanded','true');<br />
       focused = getSelected();<br />
       items[focused].focus();<br />
     }<br />
     function hideMenu(evt) {<br />
       evt.stopPropagation();<br />
       menu.style.visibility = 'hidden';<br />
       button.setAttribute('aria-expanded','false');<br />
       button.focus();<br />
     }<br />
     function getSelected() {<br />
       for (var i=0; i &lt; items.length; i++) {<br />
         if (items[i].getAttribute('aria-checked') == 'true') {<br />
           return i;<br />
         }<br />
       }<br />
     }<br />
     function setSelected(elem) {<br />
       var curSelected = getSelected();<br />
       items[curSelected].setAttribute('aria-checked', 'false');<br />
       elem.setAttribute('aria-checked', 'true');<br />
     }<br />
     function selectItem(evt) {<br />
       setSelected(evt.target);<br />
       hideMenu(evt);<br />
     }<br />
    function getPrevItem(index) {<br />
       var prev = index - 1;<br />
       if (prev &lt; 0) {<br />
         prev = items.length - 1;<br />
       }<br />
       return prev;<br />
     }<br />
     function getNextItem(index) {<br />
       var next = index + 1;<br />
       if (next == items.length) {<br />
         next = 0;<br />
       }<br />
       return next;<br />
     }<br />
    function handleButtonKeys(evt) {<br />
       evt.stopPropagation();<br />
       var key = evt.keyCode;<br />
       switch(key) {<br />
         case (13): /* ENTER */<br />
         case (32): /* SPACE */<br />
           showMenu(evt);<br />
         default:<br />
       }<br />
     }<br />
     function handleMenuKeys(evt) {<br />
       evt.stopPropagation();<br />
       var key = evt.keyCode;<br />
       switch(key) {<br />
         case (38): /* UP */<br />
           focused = getPrevItem(focused);<br />
           items[focused].focus();<br />
           break;<br />
         case (40): /* DOWN */<br />
           focused = getNextItem(focused);<br />
           items[focused].focus();<br />
           break;<br />
         case (13): /* ENTER */<br />
         case (32): /* SPACE */<br />
           setSelected(evt.target);<br />
             hideMenu(evt);<br />
             break;<br />
         case (27): /* ESC */<br />
           hideMenu(evt);<br />
            break;<br />
         default:<br />
       }<br />
     }<br />
     button.addEventListener('click', showMenu, false);<br />
     button.addEventListener('keydown', handleButtonKeys, false);<br />
     for (var i = 0;  i &lt; items.length; i++) {<br />
       items[i].addEventListener('click', selectItem, false);<br />
       items[i].addEventListener('keydown', handleMenuKeys, false);<br />
     }<br />
    &lt;/script&gt;
    <div class="custombutton" id="button" tabindex="0" role="button"
       aria-expanded="false" aria-haspopup="true">
        <span>Justify</span>
    </div>
    <div role="menu"  class="menu" id="menu" style="display : none ;">
      <div tabindex="0" role="menuitem" class="menuitem" aria-checked="true">
        Left
      </div>
      <div tabindex="0" role="menuitem" class="menuitem" aria-checked="false">
        Center
      </div>
      <div tabindex="0" role="menuitem" class="menuitem" aria-checked="false">
        Right
      </div>
    </div>
    [CSS and JavaScript for example omitted]

    3.4. Labelling

    The main issue that people know about accessibility seems to be that they have to put alt text onto images. This is only one means to provide labels to screenreaders for page content. Labels are short informative pieces of text that provide a name to a control.

    There are actually several ways of providing labels for controls :

    • on img elements use @alt
    • on input elements use the label element
    • use @aria-labelledby if there is another element that contains the label
    • use @title if you also want a label to be used as a tooltip
    • otherwise use @aria-label

    I’ll provide examples for the first two use cases - the other use cases are simple to deduce.

    Example :

    The following two images show the rough concept for providing alt text for images : images that provide information should be transcribed, images that are just decorative should receive an empty @alt attribute.

    shocked lolcat titled 'HTML cannot do that!
    Image by Noah Sussman
    <img src="texture.jpg" alt="">
    <img src="lolcat.jpg"
    alt="shocked lolcat titled ’HTML cannot do that !">
    <img src="texture.jpg" alt="">
    

    When marking up decorative images with an empty @alt attribute, the image is actually completely removed from the accessibility tree and does not confuse the blind user. This is a desired effect, so do remember to mark up all your images with @alt attributes, even those that don’t contain anything of interest to AT.

    Example :

    In the example form above in Section 2.3, when tabbing directly on the input elements, the screen reader will only say "edit text" without announcing what meaning that text has. That’s not very useful. So let’s introduce a label element for the input elements. We’ll also add checkboxes with a label.






    <label>Doctor title :</label>
      <input type="checkbox" id="doctor"/>
    <label>Firstname :</label>
      <input type="text" id="firstname2"/>
    

    <label for="lastname2">Lastname :</label>
    <input type="text" id="lastname2"/>

    <label>Address :
    <input type="text" id="address2">
    </label>
    <label for="city2">City :
    <input type="text" id="city2">
    </label>
    <label for="remember">Remember me :</label>
    <input type="checkbox" id="remember">

    In this example we use several different approaches to show what a different it makes to use the <label> element to mark up input boxes.

    The first two fields just have a <label> element next to a <input> element. When using a screenreader you will not notice a difference between this and not using the <label> element because there is no connection between the <label> and the <input> element.

    In the third field we use the @for attribute to create that link. Now the input field isn’t just announced as "edit text", but rather as "Lastname edit text", which is much more useful. Also, the screenreader can now skip the labels and get straight on the input element.

    In the fourth and fifth field we actually encapsulate the <input> element inside the <label> element, thus avoiding the need for a @for attribute, though it doesn’t hurt to explicity add it.

    Finally we look at the checkbox. By including a referenced <label> element with the checkbox, we change the screenreaders announcement from just "checkbox not checked" to "Remember me checkbox not checked". Also notice that the click target now includes the label, making the checkbox not only more usable to screenreaders, but also for mouse users.

    4. Conclusions

    This article introduced a process that you can follow to make your Web applications accessible. As you do that, you will noticed that there are other things that you may need to do in order to give the best experience to a power user on a keyboard, a blind user using a screenreader, or a vision-impaired user using a screen magnifier. But once you’ve made a start, you will notice that it’s not all black magic and a lot can be achieved with just a little markup.

    You will find more markup in the WAI ARIA specification and many more resources at Mozilla’s ARIA portal. Now go and change the world !

    Many thanks to Alice Boxhall and Dominic Mazzoni for their proof-reading and suggested changes that really helped improve the article !

  • 5-Step Conversion Rate Optimisation Checklist

    27 octobre 2023, par Erin

    Did you know the average conversion rate across e-commerce businesses in August 2023 was 2.03% ? In the past year, conversion rates have increased by 0.39%.

    Make no mistake. Just because conversion rates are higher this year doesn’t make it any easier to convert visitors.

    Cracking the secrets to improving conversion rates is crucial to running a successful website or business.

    Your site is the digital headquarters all of your marketing efforts funnel toward. With every visitor comes an opportunity to convert them into a lead (or sale).

    Keep reading if you want to improve your lead generation or convert more visitors into customers. In this article, we’ll break down a simple five-step conversion rate optimisation checklist you need to follow to maximise your conversions.

    What is conversion rate optimisation ?

    Before we dive into the steps you need to follow to optimise your conversions, let’s back up and talk conversion rate optimisation.

    Conversion rate optimisation, or CRO for short, is the process of increasing the number of website visitors who take a specific action. 

    In most cases, this means :

    • Turning more visitors into leads by getting them to join an email list
    • Convincing a visitor to fill out a contact form for a consultation
    • Converting a visitor into a paying customer by purchasing a product

    However, conversion rate optimisation can be used for any action you want someone to take on your site. That could be downloading a free guide, clicking on a specific link, commenting on a blog post or sharing your website with a friend.

    Why following a CRO checklist is important

    Conversion rate optimisation is both a valuable practice and an absolute necessity for any business or marketer. While it can be a bit complex, especially when you start diving into A/B testing, there are a variety of advantages :

    Get the most out of your efforts

    When all is said and done, if you can’t convert the traffic already coming to your site, dumping a ton of time and resources into traffic generation (whether paid or organic) won’t solve your problem.

    Instead, you need to look at the root of the problem : your conversion rate.

    By doubling down on conversions and following a conversion rate optimisation checklist, you’ll get the greatest result for the effort you’re already putting into your site.

    Increase audience size

    To increase your audience size, you need to increase your traffic, right ? Not exactly.

    While your audience may be considered people who have seen your content or follow you on social media, a high-value audience is one you can market to directly on an ongoing basis.

    Your website gives you the playground to convert visitors into high-value audience members. This is done by creating conversion-focused email signup forms and optimising your website for sale conversions.

    Generate more sales

    Boosting sales through CRO is the core objective. By optimising product pages, simplifying the checkout process, and employing persuasive strategies, you can systematically increase your sales and maximise the value of your existing traffic.

    Reduce customer acquisition costs (CAC)

    With conversion optimisation, you can convert a higher percentage of your website visitors into paid customers. Even if you don’t spend more on acquiring new customers, you’ll be able to generate more sales overall. 

    The result is that your customer acquisition costs will drop, allowing you to increase your total acquisitions to your customer base.

    Improve profitability

    While reduced customer acquisition costs mean you can pour more money into customer acquisition at a cheaper rate, you could simply maintain your costs while driving sales, resulting in increased profitability.

    If you can spend the same amount on acquisition but bring in 20% more customers (due to using a CRO checklist), your profit margins will automatically increase.

    5-step CRO checklist

    To double down on conversion rate optimisation, you need to follow a checklist to ensure you don’t miss any major optimisation opportunities.

    The checklist below is designed to help you systematically optimise your website, ensuring you make the most of your traffic by continuously refining its performance.

    1. Forms

    Analysing and optimising your website’s forms is crucial for enhancing conversion rates. Understanding how visitors interact with your forms can uncover pain points and help you streamline the conversion process.

    Ever wonder where your visitors drop off on your forms ? It could be due to lengthy, time-consuming fields or overly complex forms, leading to a frustrating user experience and lower conversion rate. Whatever the reason, you need the right tools to uncover the root of the issue.

    By leveraging Form Analytics, you gain powerful insights into user behaviour and can identify areas where people may encounter difficulties.

    Form Analytics provides the insights to discover :

    • Average time spent on each field : This metric helps you understand where users may be struggling or spending too much time. By optimising these fields, you can streamline the form, reduce user frustration and increase conversions.
    • Identifying drop-off points : Understanding where users drop off provides insights into which form fields may need improvement. Addressing these drop-off points can increase the conversion rate.
    • Unneeded fields with a high blank submission rate : Discovering fields left blank upon submission can highlight areas for simplification. By eliminating unnecessary fields, you can create more concise and user-friendly forms that may entice more visitors to engage with the form.

    Hear first-hand how Concrete CMS achieve 3x more leads with insights from Form Analytics. 

    These data-driven insights empower you to optimise your forms, remove guesswork and settle debates about form design. By fine-tuning and streamlining your forms, you can ensure a smoother path to conversion and maximise your success in converting more visitors.

    Try Matomo for Free

    Get the web insights you need, without compromising data accuracy.

    No credit card required

    2. Copywriting

    Another crucial element you need to test is your copywriting. Your copywriting is the foundation of your entire website. It helps communicate to your audience what you have to offer and why they need to take action.

    You need to ensure you have a good offer. This isn’t just the product or service you’re putting out there. It’s the complete package. It includes the product, rewards, a unique guarantee, customer service, packaging and promotions.

    Start testing your copy with your headlines. Look at the headers and test different phrases to convert more potential customers into paying customers.

    Here are a few tips to optimise your copy for more conversions :

    • Ensure copy is relevant to your headline and vice versa.
    • Write short words, short sentences and short paragraphs.
    • Use bullets and subheaders to make the copy easy to skim.
    • Don’t focus too heavily on optimising for search engines (SEO). Instead, write for humans.
    • Focus on writing about benefits, not features.
    • Write about how your offer solves the pain points of your audience.

    You can test your copy in several areas once you’ve begun testing your headers – your subheaders, body copy, signup forms and product pages (if you’re e-commerce).

    3. Media : videos and audio

    Next, testing out different media types is crucial. This means incorporating videos and audio into your content.

    Don’t just take a random guess by throwing stuff against the wall, hoping it sticks. Instead, you should use data to develop impactful content.

    Look at your Media Analytics reports in your website analytics solution and see what media people spend the most time on. See what kind of video or audio content already impacts conversions.

    Humans are highly visual. You should craft your content so it’s easy to digest. Instead of covering your website in huge chunks of text, split up your copy with engaging content like videos.

    High-quality videos and audio recordings allow your readers to consume more of your content easily, and help persuade them to take action on your site.

    4. Calls to action (CTA)

    This brings us to our next point : your call to action (CTA).

    Are you trying to convert more prospects into leads ? Want to turn more leads into customers ? Trying to get more email subscribers ? Or do you want to generate more sales every month ?

    You could write the most compelling offer flooded with beautiful images, videos and CRO tactics. But your efforts will go to waste if you don’t include a compelling CTA.

    An example of a CTA

    Here are a few tips to optimise your CTAs :

    • Keep them congruent on a single web page (e.g., don’t sell a hat and a sweater on the same page, as it can be confusing).
    • Place at least one CTA above the fold on your web pages.
    • Include benefits in your CTA. Rather than “Buy Now,” try “Buy Now to Get 30% Off.”
    • It’s better to be clear and concise than too fancy and unique.

    Optimising your call to action isn’t just about your copywriting. It’s also about design. Test different fonts, sizes, and visual elements like borders, icons and background colours.

    5. Web design

    Your site design will impact how well your visitors convert. You could have incredible copywriting, but if your site is laid out poorly, it will drive people away.

    You must ensure your copy and visual content fit your website design well.

    The first place you need to start with your site is your homepage design.

    Your site design consists of the theme or template, colour scheme and other visual elements that can be optimised to improve conversions.

    Here are a few tips to keep in mind when optimising your website design :

    • Use a colour scheme that’s pleasant rather than too distracting or extreme.
    • Ensure your design doesn’t remove the text’s clarity but makes it easier to read.
    • When in doubt, start with black text on a white background (the opposite rarely works).
    • Keep plenty of whitespace in between design elements.
    • When in doubt about font size, start by testing a larger size.
    • Design mobile-first rather than desktop-first.

    Finally, it’s critical to ensure your website is easy to navigate. Good design is all about the user experience. Is it easy to find what they’re looking for ? Simplify steps to reduce the need to click, and your conversions will increase.

    Start optimising your website for conversions

    If you’re looking to get the most out of the traffic on your site by converting more visitors into leads or customers, following this 5-step CRO checklist will help you take steps in the right direction.

    Just remember conversion rate optimisation is an ongoing process. It’s not a one-time deal. To succeed, you need to test quickly, analyse the impact and do more of what’s working and less of what’s not.

    To optimise your website for better conversion rates, you need the right tools that provide accurate data and insights to effectively increase conversions. With Matomo, you gain access to web analytics and CRO features like Form Analytics and Media Analytics, designed to enhance your conversion rate optimisation efforts. 

    Try Matomo free for 21 days and take your conversion rate to the next level. No credit card required.

  • FFmpeg avcodec_decode_video2 decode RTSP H264 HD-video packet to video picture with error

    29 mai 2018, par Nguyen Ba Thi

    I used FFmpeg library version 4.0 to have simple C++ program, in witch is a thread to receive RTSP H264 video data from IP-camera and display it in program window.

    Code of this thread is follow :

    DWORD WINAPI GrabbProcess(LPVOID lpParam)
    // Grabbing thread
    {
     DWORD i;
     int ret = 0, nPacket=0;
     FILE *pktFile;
     // Open video file
     pFormatCtx = avformat_alloc_context();
     if(avformat_open_input(&amp;pFormatCtx, nameVideoStream, NULL, NULL)!=0)
         fGrabb=-1; // Couldn't open file
     else
     // Retrieve stream information
     if(avformat_find_stream_info(pFormatCtx, NULL)&lt;0)
         fGrabb=-2; // Couldn't find stream information
     else
     {
         // Find the first video stream
         videoStream=-1;
         for(i=0; inb_streams; i++)
           if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO)
           {
             videoStream=i;
             break;
           }
         if(videoStream==-1)
             fGrabb=-3; // Didn't find a video stream
         else
         {
             // Get a pointer to the codec context for the video stream
             pCodecCtxOrig=pFormatCtx->streams[videoStream]->codec;
             // Find the decoder for the video stream
             pCodec=avcodec_find_decoder(pCodecCtxOrig->codec_id);
             if(pCodec==NULL)
                 fGrabb=-4; // Codec not found
             else
             {
                 // Copy context
                 pCodecCtx = avcodec_alloc_context3(pCodec);
                 if(avcodec_copy_context(pCodecCtx, pCodecCtxOrig) != 0)
                     fGrabb=-5; // Error copying codec context
                 else
                 {
                     // Open codec
                     if(avcodec_open2(pCodecCtx, pCodec, NULL)&lt;0)
                         fGrabb=-6; // Could not open codec
                     else
                     // Allocate video frame for input
                     pFrame=av_frame_alloc();
                     // Determine required buffer size and allocate buffer
                     numBytes=avpicture_get_size(pCodecCtx->pix_fmt, pCodecCtx->width,
                         pCodecCtx->height);
                     buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));
                     // Assign appropriate parts of buffer to image planes in pFrame
                     // Note that pFrame is an AVFrame, but AVFrame is a superset
                     // of AVPicture
                     avpicture_fill((AVPicture *)pFrame, buffer, pCodecCtx->pix_fmt,
                         pCodecCtx->width, pCodecCtx->height);

                     // Allocate video frame for display
                     pFrameRGB=av_frame_alloc();
                     // Determine required buffer size and allocate buffer
                     numBytes=avpicture_get_size(AV_PIX_FMT_RGB24, pCodecCtx->width,
                         pCodecCtx->height);
                     bufferRGB=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));
                     // Assign appropriate parts of buffer to image planes in pFrameRGB
                     // Note that pFrameRGB is an AVFrame, but AVFrame is a superset
                     // of AVPicture
                     avpicture_fill((AVPicture *)pFrameRGB, bufferRGB, AV_PIX_FMT_RGB24,
                         pCodecCtx->width, pCodecCtx->height);
                     // initialize SWS context for software scaling to FMT_RGB24
                     sws_ctx_to_RGB = sws_getContext(pCodecCtx->width,
                         pCodecCtx->height,
                         pCodecCtx->pix_fmt,
                         pCodecCtx->width,
                         pCodecCtx->height,
                         AV_PIX_FMT_RGB24,
                         SWS_BILINEAR,
                         NULL,
                         NULL,
                         NULL);

                     // Allocate video frame (grayscale YUV420P) for processing
                     pFrameYUV=av_frame_alloc();
                     // Determine required buffer size and allocate buffer
                     numBytes=avpicture_get_size(AV_PIX_FMT_YUV420P, pCodecCtx->width,
                         pCodecCtx->height);
                     bufferYUV=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));
                     // Assign appropriate parts of buffer to image planes in pFrameYUV
                     // Note that pFrameYUV is an AVFrame, but AVFrame is a superset
                     // of AVPicture
                     avpicture_fill((AVPicture *)pFrameYUV, bufferYUV, AV_PIX_FMT_YUV420P,
                         pCodecCtx->width, pCodecCtx->height);
                     // initialize SWS context for software scaling to FMT_YUV420P
                     sws_ctx_to_YUV = sws_getContext(pCodecCtx->width,
                         pCodecCtx->height,
                         pCodecCtx->pix_fmt,
                         pCodecCtx->width,
                         pCodecCtx->height,
                         AV_PIX_FMT_YUV420P,
                         SWS_BILINEAR,
                         NULL,
                         NULL,
                         NULL);
                   RealBsqHdr.biWidth = pCodecCtx->width;
                   RealBsqHdr.biHeight = -pCodecCtx->height;
                 }
             }
         }
     }
     while ((fGrabb==1)||(fGrabb==100))
     {
         // Grabb a frame
         if (av_read_frame(pFormatCtx, &amp;packet) >= 0)
         {
           // Is this a packet from the video stream?
           if(packet.stream_index==videoStream)
           {
               // Decode video frame
               int len = avcodec_decode_video2(pCodecCtx, pFrame, &amp;frameFinished, &amp;packet);
               nPacket++;
               // Did we get a video frame?
               if(frameFinished)
               {
                   // Convert the image from its native format to YUV
                   sws_scale(sws_ctx_to_YUV, (uint8_t const * const *)pFrame->data,
                       pFrame->linesize, 0, pCodecCtx->height,
                       pFrameYUV->data, pFrameYUV->linesize);
                   // Convert the image from its native format to RGB
                   sws_scale(sws_ctx_to_RGB, (uint8_t const * const *)pFrame->data,
                       pFrame->linesize, 0, pCodecCtx->height,
                       pFrameRGB->data, pFrameRGB->linesize);
                   HDC hdc=GetDC(hWndM);
                   SetDIBitsToDevice(hdc, 0, 0, pCodecCtx->width, pCodecCtx->height,
                       0, 0, 0, pCodecCtx->height,pFrameRGB->data[0], (LPBITMAPINFO)&amp;RealBsqHdr, DIB_RGB_COLORS);
                   ReleaseDC(hWndM,hdc);
                   av_frame_unref(pFrame);
               }
           }
           // Free the packet that was allocated by av_read_frame
           av_free_packet(&amp;packet);
         }
      }
      // Free the org frame
     av_frame_free(&amp;pFrame);
     // Free the RGB frame
     av_frame_free(&amp;pFrameRGB);
     // Free the YUV frame
     av_frame_free(&amp;pFrameYUV);

     // Close the codec
     avcodec_close(pCodecCtx);
     avcodec_close(pCodecCtxOrig);

     // Close the video file
     avformat_close_input(&amp;pFormatCtx);
     avformat_free_context(pFormatCtx);

     if (fGrabb==1)
         sprintf(tmpstr,"Grabbing Completed %d frames", nCntTotal);
     else if (fGrabb==2)
         sprintf(tmpstr,"User break on %d frames", nCntTotal);
     else if (fGrabb==3)
         sprintf(tmpstr,"Can't Grabb at frame %d", nCntTotal);
     else if (fGrabb==-1)
         sprintf(tmpstr,"Couldn't open file");
     else if (fGrabb==-2)
         sprintf(tmpstr,"Couldn't find stream information");
     else if (fGrabb==-3)
         sprintf(tmpstr,"Didn't find a video stream");
     else if (fGrabb==-4)
         sprintf(tmpstr,"Codec not found");
     else if (fGrabb==-5)
         sprintf(tmpstr,"Error copying codec context");
     else if (fGrabb==-6)
         sprintf(tmpstr,"Could not open codec");
     i=(UINT) fGrabb;
     fGrabb=0;
     SetWindowText(hWndM,tmpstr);
     ExitThread(i);
     return 0;
    }
    // End Grabbing thread  

    When program receive RTSP H264 video data with resolution 704x576 then decoded video pictures are OK. When receive RTSP H264 HD-video data with resolution 1280x720 it look like that first video picture is decoded OK and then video pictures are decoded but always with some error.

    Please help me to fix this problem !

    Here is problems brief :
    I have an IP camera model HI3518E_50H10L_S39 (product of China).
    Camera can provide H264 video stream both at resolution 704x576 (with RTSP URI "rtsp ://192.168.1.18:554/user=admin_password=tlJwpbo6_channel=1_stream=1.sdp ?real_stream") or 1280x720 (with RTSP URI "rtsp ://192.168.1.18:554/user=admin_password=tlJwpbo6_channel=1_stream=0.sdp ?real_stream").
    Using FFplay utility I can access and display them with good picture quality.
    For testing of grabbing from this camera, I have a simple (above mentioned) program in VC-2005. In "Grabbing thread" program use FFmpeg library version 4.0 for opening camera RTSP stream, retrieve stream information, find the first video stream... and prepare some variables.
    Center of this thread is loop : Grab a frame (function av_read_frame) - Decode it if it’s video (function avcodec_decode_video2) - Convert to RGB format (function sws_scale) - Display to program window (GDI function SetDIBitsToDevice).
    When proram run with camera RTSP stream at resolution 704x576, I have good video picture. Here is a sample :
    704x576 sample
    When program run with camera RTSP stream at resolution 1280x720, first video picture is good :
    First good at res.1280x720
    but then not good :
    not good at res.1280x720
    Its seem to be my FFmpeg function call to avcodec_decode_video2 can’t fully decode certain packet for some reasons.