I'm coding a Premiere plugin using the SDK provided by Adobe. I want my function to be able to be sensitive to whether the media is audio only or video (with or without audio), e.g. whether it's a .wav or a .mp4. I want this to happen before any clips are on any timelines, so I can't use the track.mediaType attribute.
I am trying to do this when the media is a project item but am not finding anything in the documentation (https://premiere-scripting-guide.readthedocs.io/4%20-%20Project%20Item%20object/projectItem.html?highlight=mediaType)
For now, this is what I'm doing:
GetProjectItemType: function (projectItem){
if (projectItem.name.includes("wav") || projectItem.name.includes("mp3") || projectItem.name.includes("AIFF") )
return "Audio";
else
return "Video";
}
There is a function that you can use referenced in the Adobe-CEP/Samples
projectItem.type
https://github.com/Adobe-CEP/Samples/blob/f86975c3689e29df03e7d815c3bb874045b7f991/PProPanel/jsx/PPRO/Premiere.jsx#L1614
ex.
this can help you differentiate between other projectItems such as Bins, Clips and Files and you can use this in combination with your current implementation to ensure you have either audio or video projectItem and not bin