Guidelines for making Play To friendly web pages

Similar to the Windows Store app experience, Play To is automatically enabled for music, videos, and images in Internet Explorer in the new Windows UI. This sections outlines some tips to ensure that Play To works well with your web page.

Internet Explorer in the Windows UI has a heuristic that attempts to identify the best media item to use as the Play To source. The heuristic favors elements that are currently playing, selected, in-focus, and actively in view.

Music and video elements that are 5 seconds or less, and images that are 300x300 pixels or smaller, are ignored by the heuristic and never automatically enabled.

The Play To heuristic works well for simple web pages that only have one primary media element, such as one big photo or one big video. But for more complex pages that have multiple videos or a complex slideshow experience, some help is required from the web developer to correctly identify the best element. Here are some tips to ensure the best possible experience.

General Tips

  • The msPlayToPrimary attribute can be specified on any audio, video, or image tag. This attribute specifies that the element is always the one selected for Play To, regardless of any other considerations.

    Example: <video src="movie.mp4" msPlayToPrimary="true">

    Example: document.getElementById("my_video").msPlayToPrimary = true;

  • The msPlayToDisable attribute can be specified to opt an element out of the heuristic and Play To experience in Internet Explorer in the Windows UI. For example, this can be used to prevent video ads from being selected.

  • Attempt to minimize the number of audio, video, and image elements on a given page. Providing a slideshow experience to display just one image at a time can help make a site work well with Play To, even if the non-slideshow experience is complicated.

Audio & Video Tips

  • Elements that are playing are preferred over non-playing elements. So elements that are marked as autoplay, or start playing from script, are more likely to be selected.

  • If there are multiple elements on a page, Play To element selection looks for another eligible element once the current element ends. So, a playlist can be arranged by starting the next element from script after or shortly before the previous element completes.

Audio Tips

  • Audio should not be muted and the volume should be greater than 0.

  • The duration of the audio must be greater than 5 seconds.

  • Audio elements do not need to be attached to the Document Object Model (DOM). An audio element created by script is still eligible for Play To.

Video Tips

  • Video elements must be attached to the DOM.

  • The video must be in view and be visible.

Image Tips

  • Images are only selected if there are no eligible video or audio elements on the page. If an image is the desired target for Play To, ensure that all audio elements point to audio less than 5 seconds long and all video elements are hidden.

  • Images must be at least 300 pixels wide and at least 300 pixels long in order to be eligible.

  • The largest image on the page will be selected. It is possible to have a photo album experience with multiple images on the page, but the desired Play To element should have a significantly larger image than other image elements on the page.

 

 

Build date: 12/16/2013