I am using Video.js library for my video player.The video source is coming from Autodesk BIM360 Docs and that needs authentication. How can I open BIM360 video file in my video player?
Any help would be highly appreciated.
I am using Video.js library for my video player.The video source is coming from Autodesk BIM360 Docs and that needs authentication. How can I open BIM360 video file in my video player?
Any help would be highly appreciated.
For this you need to get the endpoint of video and request with headers Authorization: Bearer
The way you get end point is from forge Data Management Api, you can list Hubs > Projects > Folders > Items > Versions.
A file can have 1+ versions, so that's why you need the specific version. This tutorial guides you on the steps.
Once you get the version, check the relationship.storage.data.id for ex it will be like this:
"id": "urn:adsk.objects:os.object:wip.dm.prod/9f8bdc3f-e29c-4ada-ab7b-bb8dfa821163.pdf"
Take the last part of the above id and form the endpoint like below shown, your video endpoint becomes: https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/9f8bdc3f-e29c-4ada-ab7b-bb8dfa821163.mp4
here is the api for reference: https://developer.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectName-GET/
When using video.js library after src, set headers as shown below:
let mp4 = {
src: "https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/9f8bdc3f-e29c-4ada-ab7b-bb8dfa821163.mp4",
"headers": {
"authorization": "Bearer token
}
type: "video/mp4"
};