UNPKG

@googleforcreators/media

Version:

Functionality for creating and working with media resources in the Web Stories editor.

3 lines (2 loc) 677 B
import e from"./getTypeFromMime.js";import{ResourceType as t}from"./types/resourceType.js";function i({type:i,mimeType:r,poster:o,posterId:s,length:d,lengthFormatted:p,sizes:m={},output:h,width:n=0,height:a=0,isPlaceholder:l=!1,isOptimized:u=!1,isMuted:g=!1,isExternal:y=!1,trimData:c,needsProxy:f=!1,...x}){const z={type:i=i||e(r),mimeType:r,width:n,height:a,sizes:m,isPlaceholder:l,isExternal:y,needsProxy:f,...x},F={poster:o,posterId:s,isOptimized:u};return i===t.Video?{...z,...F,length:d,lengthFormatted:p,isMuted:g,trimData:c}:i===t.Gif?{...z,...F,output:h}:i===t.Audio?{...z,length:d,lengthFormatted:p}:z}export{i as default}; //# sourceMappingURL=createResource.js.map