HTML5 has become the standard for video and audio on the web moving away from plugin based players. Native video on twitter.com is already served via HTML5 video players and this is the right time to complete the transition to HTML5 across all Twitter media player products. With this update, we’ll ensure delivery of the best video experience to our users by providing better performance, improved security, and mobile compatibility where more than 80% of Twitter users consume your video and audio content.
Full deprecation of plug-in support
We previously announced that sandboxing would be enforced for new Player Cards. This meant that plugins such as Flash could no longer be used within newly published Player Cards. To further improve the video and audio experience for our users, all Player Cards will now be sandboxed regardless of publish date. On June 20, 2016, browser plugins including Flash will not function and can no longer be used on twitter.com.
Improved display and play behavior
Player Cards on web now have an improved layout and play behavior. You can now enable your Player Card to play upon first click. Previously, Player Cards were not allowed to autoplay on load — and in some scenarios, caused users to click through two play buttons to initiate playback. Additionally, the new Player Card layout will now display in timeline along with all other card types on web. Stay tuned for in-timeline support on mobile.
What do I need to do?
To transition from plugin-based video players
We encourage all developers using Player Cards to use HTML5-based video players. There are many open source HTML5 video player libraries such as VideoJS and MediaElementJS to aid in your transition. Additionally, ensure that all assets are loaded over HTTPS to avoid mixed content. To test if your current video player will work on twitter.com’s sandboxed environment, refer to this code on codepen.io. If you do not intend to migrate to an HTML5 player, we recommend utilizing the Summary Card to link to your website where your video or audio player is hosted. These updates should be completed by June 20, 2016.
To update your Player Card to play on first click
When a user clicks on the new Player Card layout, an iframe will be rendered with the URL you define in the twitter:player meta tag as the source. When autoplay is available, twitter.com will add a query string parameter of autoplay=1 to the twitter:player URL. Use this parameter to determine if your video player should autoplay. Your video player should only autoplay when this parameter and value is present. Adding the parameter to the URL yourself will result in a violation and your player may be suspended.
As usual please reach out to us in the Cards forum with questions or concerns you may have regarding this update.