Skip to main content
Joxd
Participant
July 26, 2020
Question

Determine audio or video upon import

  • July 26, 2020
  • 1 reply
  • 284 views

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"; 
    }

 

 

Is there a way to accomplish this? Thanks! 

    This topic has been closed for replies.

    1 reply

    JapinderSandhu
    Inspiring
    October 1, 2020

    @Bruce Bullis 

     

    Is there a way to use projectItem.type to get the result of video or audio? Or is it only for CLIP, BIN, FILE ? What is the difference between a CLIP & FILE ? 

     

    Is a CLIP a FILE? 

     

    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.

    if ((projectItem.type === ProjectItemType.CLIP) || (projectItem.type === ProjectItemType.FILE)) {
    
    }
    
    

     

    Bruce Bullis
    Community Manager
    Community Manager
    October 1, 2020

    Those type delineations are a little flexible, because a sequence can be a clip (i.e., can be inserted into other sequences), but it's not a file.