Preparing search index...

    Represents an animated movie or video file.

    export class MoviePanel extends PanelPlugin {
    connections: any[];
    static descriptor() {
    const d = new Descriptor();
    d.id = 'com.docs.UiMovieExample';
    d.name = 'Movie Example';
    d.defaultDockState = DockState.Detached;
    d.defaultSize = new Size(350, 300);
    return d;
    }
    constructor(pluginSystem: Editor.PluginSystem, descriptor?: Descriptor) {
    super(pluginSystem, descriptor);
    this.connections = [];
    }
    createWidget(parent: Widget): Widget {
    const root = new Widget(parent);
    const layout = new BoxLayout();
    layout.setDirection(Direction.TopToBottom);
    layout.spacing = 8;
    root.layout = layout;

    const title = new Label(root);
    title.text = 'Movie Demo';
    title.fontRole = FontRole.TitleBold;
    layout.addWidget(title);

    // Movie loads an animated image (GIF, APNG) from a file path
    const movie = new Movie(new Editor.Path('spinner.gif'));
    movie.speed = 100;
    movie.resize(64, 64);

    // MovieView displays a Movie animation
    const view = new MovieView(root);
    view.movie = movie;
    view.animated = true;
    view.scaledContents = true;
    layout.addWidget(view);

    const info = new Label(root);
    info.text = 'Movie: speed=' + movie.speed + ', size=' + movie.width + 'x' + movie.height;
    layout.addWidget(info);

    return root;
    }
    deinit(): void {
    this.connections.forEach((c: any) => c?.disconnect());
    this.connections = [];
    }
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    cacheMode: CacheMode
    frameCount: number
    height: number

    The width of the movie in pixels

    speed: number

    The height of the movie in pixels

    width: number

    The playback speed of the movie

    Methods

    • Returns true if the object is of the specified type.

      Parameters

      • type: string

      Returns boolean

    • Parameters

      • frame: number

      Returns boolean

    • Resizes the movie to the specified width and height

      Parameters

      • width: number
      • height: number

      Returns void