VideoPress: update to the new player
@see https://en.blog.wordpress.com/2015/07/01/videopress-next/
It seems we'll need to port the changes to Jetpack in the next release.
Related: #2338 #2337
This is not a point release change. It will have to be a major release.
Couple notes on the implementation. There are two ways to embed VideoPress: directly or with an iframe.
The direct one has two obvious advantages: avoiding an extra roundtrip and theme customizability. The API for it is documented here.
We do a pretty good job at isolating and redefining styles to avoid depending on global CSS or conflicts with it. That said, conflicts can still occur, and we haven't thoroughly tested the player under those circumstances. Here's where your help would be useful since you probably have a good testing bed of themes and sites with which you test JetPack.
For most users, however, we offer a snippet like the following (which you can access if you click SHARE on a video)
<iframe width="560" height="315" src="https://videopress.com/embed/kUJmAcSf" frameborder="0" allowfullscreen></iframe>
<script src="https://videopress.com/videopress-iframe.js"></script>
Notice the extra <script>, which can actually be ditched for sites that filter them out. Essentially, we embed an iframe with a predefined size, and if the script can load, it's in charge of resizing the video player automatically.
Something we're missing is a layer of RPC between the player inside the iframe and the external script. I'm envisioning something like this:
vpc(iframeElement)
.play()
.then(function(){
console.log('success');
});
The vpc interface would take an iframe reference, and establish a postMessage communication channel. It would expose commands that are useful for implementing features like "autoplay when the video becomes visible" even when using the iframe. It's worth noting that this feature is already implemented when not using it.
It's more than likely that we'll have two support both ways of embedding the player even in the long haul. Ideally, WordPress.com themes, Reader and P2s will embed the player directly for performance reasons, and JetPack will use an <iframe> with a complete communication channel to access the VP API.
Also, we have an example showing how to upload directly from any 3rd party site via wpcom.js (thanks @retrofox!).
https://github.com/Automattic/videopress-tester/blob/initial/index.js
This is additionally an awesome way to test the player upgrading from the conversion state to the fully loaded player.
@rauchg https://github.com/automattic/videopress#api and https://github.com/Automattic/videopress-tester/blob/initial/index.js are both dead links now.
Very excited about the VideoPress improvements though! :) Looking forward to trying them out.
@EnigmaSolved Those are private internal repositories, for the moment, sorry!
@georgestephanis That makes sense--thanks for the clarification! :)
This is resolved in 3.7