Comments (5)
I think that's fine @davidmpurdy, I'll try to get that done today.
If I may check my understanding, you're working towards having an AJAX query fetch the signed URL, so this separate function should provide everything prior to that?
Current returns something like (varying a little depending on the chosen media domain):
https://customer-[someid].cloudflarestream.com/[signedURL]/iframe?poster=https://customer-[someid].cloudflarestream.com/[signedURL]/thumbnails/thumbnail.jpg
Separate function would return something like?
https://customer-[someid].cloudflarestream.com/
So perhaps a media domain specific function?
from cloudflare-stream-wordpress.
There's a bit of a complication with this and I'm still nutting out how to simplify. It stems from the difference between the standard domains, and the account specific subdomain:
Standard domain style:
https://iframe.cloudflarestream.com/SIGNEDTOKEN?
Account specific sub-domain style:
https://customer-0123456789abcdef.cloudflarestream.com/SIGNEDTOKEN/iframe?
The options that I see at the moment are (in order of preference highest to lowest):
- Provide the full embed code, but place
UID
in as a placeholder and perform a case sensitive string replacement in JavaScript with the AJAX obtained signed token. The potential advantage here is consolidation of code (avoid separate block vs shortcode handling), and preferences like playback parameters. String replacement would also handle theposter
URI. So it'd look something like this:
<iframe src="https://customer-0123456789abcdef.cloudflarestream.com/UID/iframe?muted=true&loop=true&autoplay=true&poster=https://customer-0123456789abcdef.cloudflarestream.com/UID/thumbnails/thumbnail.jpg" style="border: none; position: absolute; top: 0; height: 100%; width: 100%" allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;" allowfullscreen="true" id="stream-player"></iframe>
- Similar to 1, but only part of the URI, not the full embed code, and no parameters. This requires separate parameter handling for blocks. Something like this:
https://customer-0123456789abcdef.cloudflarestream.com/UID/iframe?
- Return only the basic media domain without any UID placeholder, and the requesting function will need to decipher and handle it accordingly. When using the account specific domain, that'd be something like this:
https://customer-0123456789abcdef.cloudflarestream.com
So I'm leaning towards 1, but might you have any thoughts, concerns or ideas?
from cloudflare-stream-wordpress.
I've made a branch for testing option 1 here: 68232ae
from cloudflare-stream-wordpress.
I've added this issue to the WordPress Submission Ready milestone, as I think the ability to browse the Stream library is an important feature off the bat.
from cloudflare-stream-wordpress.
Sorry I haven't made progress on this. I keep getting projects coming down the line that need to jump to the front of the queue, and every time I sit down to do this something else comes up.
I'm planning to do a PR to split the first part of get_video_embed
into a get_video_url
function which generates the $src_uri
from the $uid
. With that, the block can get the URL from the server and just handle querystring parameters on the JS side. I think it's the best compromise between the official recommendation of not rendering on the server if not necessary (still doing querystring client side) but also recognizing that in some situations (signed URLs), we will need information from the server.
from cloudflare-stream-wordpress.
Related Issues (20)
- Switch from zones to accounts API HOT 8
- Playback defaults in admin settings HOT 1
- Not all URL parameters work in iframe embed player HOT 5
- Admin CSS enqueued in wrong class.
- Deprecation of plugins use of zones API
- Preload behaviour for video embed HOT 2
- Unify rendering of block and shortcode
- Plugin name / permalink slug currently conflicts with Cloudflare Stream HOT 1
- Update readme.txt
- WordPress plugin adoption HOT 7
- Add support for posters (cover photo) for signed url videos HOT 6
- Shotcode sizing issues HOT 7
- Use signed URLs for videos inserted with the block HOT 4
- Removal of analytics HOT 4
- Upgrade path for existing blocks HOT 3
- Update the block player to the new iframe player HOT 5
- Option for account specific sub-domains HOT 6
- Localization updates HOT 2
- Upload button is missing HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudflare-stream-wordpress.