Comments (6)
Yes, thank you! I have this working, I just thought I'd recommend adding an example as well.
from mux-node-sdk.
We recently refreshed the guide for doing signed playback URLs (w/ optional playback restrictions): https://docs.mux.com/guides/secure-video-playback
Closing because this is not a specific issue related to the node SDK
from mux-node-sdk.
Hi @apettenati, thanks for bringing this up! I hope you figured it out, and we can definitely add more documentation.
As of right now we have one example here with the node SDK if you click the "node" tab
Short answer is you pass in playback_restriction_id:
in with the extra params
const { JWT } = require('@mux/mux-node');
JWT.sign(playbackId, {
params: { playback_restriction_id: YOUR_PLAYBACK_RESTRICTION_ID },
})
let me know if that helps!
from mux-node-sdk.
how do you create the playback restriction?
when do you create the signed playback id?
how do you insert it to you mux-player?
how do you know the signed playback id is expired and you need to create a new one?
this is so confusing
from mux-node-sdk.
ok so I can create the playback restriction using postman (is there a ui option coming?)
https://www.youtube.com/watch?v=rd1os9jDTtg
I create the signed playback id everytime I load the video asset but this makes loading the asset slower
Insert it into mux-player like this:
[attr.playback-id]="file.playbackId"
[attr.playback-token]="signedUrls.playback"
[attr.thumbnail-token]="signedUrls.thumbnail"
[attr.storyboard-token]="signedUrls.storyboard"
How do you know the signed playback id is expired and you need to create a new one?
Can't find any info about this?
from mux-node-sdk.
@rubenheymans you'll want to set the expiration to a timeframe longer than the length of the video, with some buffer because a user might pause and come back later, scrub, etc.
If the token is expired the player will throw a 403 error and you can catch that, make an API request to get refreshed tokens.
from mux-node-sdk.
Related Issues (20)
- Critical CVEs HOT 4
- Implementation List HOT 2
- StaticRendition incorrect type HOT 2
- Missing types export in package.json HOT 1
- Incorrect types for `inputInfo` HOT 1
- Webhook Types HOT 4
- TypeError: mux_node_1.default is not a constructor HOT 4
- Webhooks: ERROR [ExceptionsHandler] No signatures found matching the expected signature for payload. HOT 3
- Error: secretOrPrivateKey must be an asymmetric key when using RS256 HOT 6
- Missing types for `resolution_tier` and `max_resolution_tier` HOT 1
- Add `generated_subtitles` to the interface CreateAssetParams.input HOT 3
- passthrough not present in video.asset.track.ready event HOT 5
- Announcement: Version 8 released to address many pain points HOT 1
- Issue with new "react-native-nodemediaclient" version HOT 1
- Confusion regarding missing fields in AbridgedVideoView interface after upgrading to SDK v8.0.0 HOT 4
- Unauthorised request when creating live stream HOT 1
- Unable to find module @mux/mux-node/_shims/auto/jwt HOT 6
- JWT shim does not exist for Bun HOT 2
- Bug: Setting "test: true" when creating a direct upload does not create a test asset 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 mux-node-sdk.