Hierarchy

Methods

  • Stop the animation.

    Parameters

    • notification: boolean = true

    Returns Promise<void>

  • Set the number of times the animation will repeat. The default is 1, which means the animation will play only once. 0 means the animation will play infinity times.

    Parameters

    • repeatCount: number

    Returns void

  • Returns the current progress of play position, the value is from 0.0 to 1.0. It is applied only when the composition is not null.

    Returns number

  • Set the progress of play position, the value is from 0.0 to 1.0.

    Parameters

    • progress: number

    Returns number

  • If set to true, PAG renderer caches an internal bitmap representation of the static content for each layer. This caching can increase performance for layers that contain complex vector content. The execution speed can be significantly faster depending on the complexity of the content, but it requires extra graphics memory. The default value is true.

    Returns boolean

  • This value defines the scale factor for internal graphics caches, ranges from 0.0 to 1.0. The scale factors less than 1.0 may result in blurred output, but it can reduce the usage of graphics memory which leads to better performance. The default value is 1.0.

    Returns number

  • The maximum frame rate for rendering. If set to a value less than the actual frame rate from PAGFile, it drops frames but increases performance. Otherwise, it has no effect. The default value is 60.

    Returns number

  • Call this method to render current position immediately. If the play() method is already called, there is no need to call it. Returns true if the content has changed.

    Returns Promise<boolean>

  • Free the cache created by the pag view immediately. Can be called to reduce memory pressure.

    Returns void

  • Sets a new PAGComposition for PAGView to render as content. Note: If the composition is already added to another PAGView, it will be removed from the previous PAGView.

    Parameters

    Returns void

  • Set the transformation which will be applied to the composition. The scaleMode property will be set to PAGScaleMode::None when this method is called.

    Parameters

    Returns void

  • Prepares the player for the next flush() call. It collects all CPU tasks from the current progress of the composition and runs them asynchronously in parallel. It is usually used for speeding up the first frame rendering.

    Returns Promise<void>

  • Returns a ImageBitmap object capturing the contents of the PAGView. Subsequent rendering of the PAGView will not be captured. Returns null if the PAGView hasn't been presented yet.

    Returns Promise<ImageBitmap>

Constructors

Properties

repeatCount: number = 0

The repeat count of player.

isPlaying: boolean = false

Indicates whether or not this pag view is playing.

isDestroyed: boolean = false

Indicates whether or not this pag view is destroyed.

pagViewOptions: PAGViewOptions = ...
renderCanvas: null | RenderCanvas = null
pagGlContext: null | BackendContext = null
frameRate: number = 0
pagSurface: null | PAGSurface = null
player: PAGPlayer
playFrame: number = -1
canvasElement: null | HTMLCanvasElement | OffscreenCanvas
timer: null | number = null
flushingNextFrame: boolean = false
playTime: number = 0
startTime: number = 0
repeatedTimes: number = 0
eventManager: EventManager<PAGViewEventMap, PAGView> = ...

Generated using TypeDoc