import { a as ImageBaseModel } from "./background.js";
class VideoModel extends ImageBaseModel {
  constructor(data) {
    if (typeof data.duration !== "number" && typeof data.naturalDuration !== "number") {
      throw new Error("Video \u5143\u7D20\u7F3A\u5C11 duration \u6216 naturalDuration \u5C5E\u6027");
    }
    super(data);
    if (!this.naturalDuration && this.duration) {
      this.naturalDuration = Math.round(this.duration * 1e3);
    }
    if (typeof data.loop === "boolean") {
      this.loop = data.loop ? 0 : 1;
    }
    this.endTime = Math.min(this.endTime || this.naturalDuration, this.naturalDuration);
    delete this.duration;
  }
}
export { VideoModel as V };
