Hi all,
Another release of Premiere 26.5 brings with it new updates to share for Premiere’s UXP APIs. You can also read this on the Premiere 26.5 Changelog and our updated API doc pages.
New APIs
A number of new APIs have been added in this release. More details on each can be seen in each class’s documentation page. If you’d like to see more examples of using all of these new APIs in action, check out the premiere-api sample panel in the UXP Premiere Pro Samples repository.
- A new
C2PAServiceclass has been added to help with returning CAI-related information associated with a file. Additional constantsConstants.C2PAManifestLocationhave been added, associated with the manifest location return value fromC2PAService.getManifest Media.getDurationandMedia.getStartsynchronous functions have been added. See more about this in the deprecations section below.- A new
MediaManagerclass has been added. Currently this supports the ability to purge the media cache. - The
Transcriptclass continues to get new functionality:isLanguagePackAvailablecan help check if a particular language pack is available for a given language code.transcribeClipProjectItemgenerates a transcription for a givenClipProjectItem, and settles when the transcription completes.
- A new
WorkAreaUtilsclass includes several functions for setting or clearing in/out points for the current work area.
UXP Host Additions
We’ve also added some new functionality to the UXP host object.
applicationPath: stringis a readonly string property which contains the absolute path to the currently running Premiere application.const uxp = require("uxp"); console.log(uxp.host.applicationPath); // e.g., "/Applications/Adobe Premiere Pro (Beta)/Adobe Premiere Pro (Beta).app" on macOS // "C:\\Program Files\\Adobe\\Adobe Premiere Pro (Beta)\\Adobe Premiere Pro (Beta).exe" on WindowsgetBackgroundColor(): Promise<string>provides information on the current background color of the Premiere application.const uxp = require("uxp"); const backgroundColor = JSON.parse(await uxp.host.getBackgroundColor()); backgroundColor.type; // "rgb" backgroundColor.value.alpha; // 1 // RGB colors are a value between 0 and 1 backgroundColor.value.blue; backgroundColor.value.green; backgroundColor.value.red;
Bug Fixes
ClipProjectItem’screateSetInPointActionandcreateSetOutPointActionno longer error when called.- Calling
ComponentParam.getValueAtTimewithout any argument would result in the function returning aPromisewhich would never settle. Now thePromisewill reject with an error when called this way. - Calling
Markers.getMarkerswith anyfiltersargument applied would typically throw an error. This has been fixed and should allow for correctly filtering down to the desired set of Marker types.const sequence: Sequence = ... const mySquenceMarkers: Markers = await Markers.getMarkers(sequence); // Returns any Comment or WebLink markers on the above sequence. // Other filter types include "Chapter" and "FLVCuePoint" const myMarkers: Marker[] = mySequenceMarkers.getMarkers(["Comment", "WebLink"]); - Calling
Project.importAECompsorProject.importAllAECompswithout a target bin defaults to adding the imported compositions to the root bin of the Project, but this was sometimes inconsistent and would resolvetruewhile not actually adding anything to the project. We’ve fixed this to correctly handle this default and add the imported compositions to the project.
Deprecations
Media.start and Media.duration properties
Instances of the Media class contain two async properties which, in comparison to the rest of the available classes and properties, are a bit unusual and awkward to work with:
const media: Media = ...
// These properties return Promises and must either be `await`ed or
// require using `.then()` Promise chaining syntax to use correctly
const start = await media.start;
const duration = await media.duration;
We’ve opted to deprecate these properties in favor of newly-added getStart()/getDuration() synchronous functions. This was chosen primarily for backwards compatibility instead of changing the properties insitu from asynchronous to synchronous:
const media: Media = ...
// No `async` usage required!
const start = media.getStart();
const duration = media.getDuration();
The asynchronous start and duration properties will be removed in a future version of Premiere.
Constants.MarkerColor.MAGNETA
It turns out we also had an incorrectly spelled constant for MarkerColor called MAGNETA. While the value of this constant is correct for API usage, the slight mispelling of MAGNETA instead of MAGENTA just didn’t sit right. We’ve gone ahead and deprecated the previous MAGNETA color in favor of a properly spelled MAGENTA, and will plan on removing the mispelled constant in a future version of Premiere.
- const myFavoriteColor = ppro.Constants.MarkerColor.MAGNETA;
+ const myFavoriteColor = ppro.Constants.MarkerColor.MAGENTA;
Documentation Updates
Outside of the above core changes, we’ve also updated our documentation and TypeScript declarations to address some inconsistencies. We’ll continue reviewing these and working to make sure these are as accurate as possible.
ClipProjectItem.getComponentChainnow correctly documents aPromise<AudioComponentChain | VideoComponentChain | null>return type versus the originally mistypedPromise<string>- The return type documented for
AudioTrack.createSetNameAction,CaptionTrack.createSetNameAction, andVideoTrack.createSetNameActionhave been corrected to anActiontype instead ofobject. Project.saveAsdocumentation is more specific about its behavior: calling this will result in creating a copy of the project, and theprojectinstance itself will refer to the copy, not the original project. This is in line with the same behavior you would see when clicking “File > Save As” in the application menu.const project = await Project.open("path/to/MyProject.prproj") await project.saveAs("path/to/MyCopiedProject.prproj"); // `project` now refers to "MyCopiedProject" instead of "MyProject"- Several classes which can be directly constructed (e.g., via
new) now have a “Constructor” section on their respective documentation pages. These classes include:AAFExportOptions,AddTransitionOptions,CloseProjectOptions,Color,FrameRate,Guid,OpenProjectOptions,PointF,RectF, andTickTime. Additional details on available parameters can also be seen with their constructor section. We’ll continue improving the documentation for descriptions and usage soon!