title: Dailymotion video autoplay and muted
body: <p>I am currently working on a project where i need to display a Dailymotion video that is automatically launched in muted mode. According to the documentation - <a href="http://www.dailymotion.com/doc/api/sdk-javascript.html" rel="nofollow">http://www.dailymotion.com/doc/api/sdk-javascript.html</a> - the DM.player is able to manipulate the volume of a video (method: setMuted(muted)). However, after many changes in my code, i cannot figure out how this works.
  Have you ever done this before ? Could you provide some help please ?</p>
  
  <p>Thanks</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
    &lt;script src="http://api.dmcdn.net/all.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;div id="myPlayer"&gt;&lt;/div&gt;
  
    &lt;script&gt;
      // This function init the player once the SDK is loaded
      window.dmAsyncInit = function() {
        // PARAMS is a javascript object containing parameters to pass to the player if any (eg: {autoplay: 1})
        var player = DM.player("myPlayer", {video: "xz0ytt", width: "480", height: "270"});
  
        // 4. We can attach some events on the player (using standard DOM events)
        player.addEventListener("apiready", function(e) {
          // alert(e.target.muted);
          // e.target.muted = true;
          // alert(e.target.muted);
          // e.target.play();
          // player.setMuted(1);
          player.setMuted("1");
          e.target.play();
        });
      };
    &lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>