jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

VideoPress: update to the new player

Open jeherve opened this issue 11 years ago • 7 comments

@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

jeherve avatar Jul 02 '15 14:07 jeherve

This is not a point release change. It will have to be a major release.

georgestephanis avatar Jul 02 '15 14:07 georgestephanis

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.

rauchg avatar Jul 02 '15 20:07 rauchg

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 avatar Jul 02 '15 21:07 rauchg

@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 avatar Jul 05 '15 23:07 EnigmaSolved

@EnigmaSolved Those are private internal repositories, for the moment, sorry!

georgestephanis avatar Jul 08 '15 16:07 georgestephanis

@georgestephanis That makes sense--thanks for the clarification! :)

EnigmaSolved avatar Jul 08 '15 18:07 EnigmaSolved

This is resolved in 3.7

zinigor avatar Aug 25 '15 22:08 zinigor