Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VideoClip

The video clip asset.

Hierarchy

Index

Constructors

constructor

Properties

Protected _duration

_duration: number = 0

Protected _name

_name: string

_native

_native: string = ""

Serializable url for native asset. For internal usage.

default

""

_nativeUrl

_nativeUrl: string = ""

_objFlags

_objFlags: number

_uuid

_uuid: string

Protected _video

_video: any = null

loaded

loaded: boolean = true

Whether the asset is loaded or not

Static preventDeferredLoadDependents

preventDeferredLoadDependents: boolean = false

Indicates whether its dependent native assets can support deferred load if the owner scene (or prefab) is marked as asyncLoadAssets.

default

false

Static preventPreloadNativeObject

preventPreloadNativeObject: boolean = false

Indicates whether its native object should be preloaded from native url.

default

false

Accessors

nativeAsset

  • get nativeAsset(): any
  • set nativeAsset(clip: any): void

nativeDep

  • get nativeDep(): undefined | { __isNative__: boolean; ext: string; uuid: string }

isValid

  • get isValid(): boolean
  • Indicates whether the object is not yet destroyed. (It will not be available after being destroyed)
    When an object's destroy is called, it is actually destroyed after the end of this frame. So isValid will return false from the next frame, while isValid in the current frame will still be true. If you want to determine whether the current frame has called destroy, use isValid(obj, true), but this is often caused by a particular logical requirements, which is not normally required.

    default

    true

    readonly
    example
    import { Node, log } from 'cc';
    const node = new Node();
    log(node.isValid);    // true
    node.destroy();
    log(node.isValid);    // true, still valid in this frame
    // after a frame...
    log(node.isValid);    // false, destroyed in the end of last frame

    Returns boolean

name

  • get name(): string
  • set name(value: string): void

nativeUrl

  • get nativeUrl(): string

refCount

  • get refCount(): number

Methods

destroyImmediate

  • _destroyImmediate(): void

destruct

  • _destruct(): void
  • Clear all references in the instance.

    NOTE: this method will not clear the getter or setter functions which defined in the instance of CCObject. You can override the _destruct method if you need, for example: _destruct: function () { for (var key in this) { if (this.hasOwnProperty(key)) { switch (typeof this[key]) { case 'string': this[key] = ''; break; case 'object': case 'function': this[key] = null; break; } } }

    Returns void

Private setRawAsset

  • setRawAsset(filename: string, inLibrary?: boolean): void

addRef

Optional createNode

decRef

  • decRef(autoRelease?: boolean): Asset

destroy

  • destroy(): boolean
  • Destroy this Object, and release all its own references to other objects.
    Actual object destruction will delayed until before rendering. From the next frame, this object is not usable any more. You can use isValid(obj) to check whether the object is destroyed before accessing it.

    example
    obj.destroy();

    Returns boolean

    whether it is the first time the destroy being called

onLoaded

  • onLoaded(): void

Private serialize

  • serialize(): void

toString

  • toString(): string
  • Returns the string representation of the object.
    The Asset object overrides the toString() method of the Object object.
    JavaScript calls the toString() method automatically
    when an asset is to be represented as a text value or when a texture is referred to in a string concatenation.

    For assets of the native type, it will return this.nativeUrl.
    Otherwise, an empty string is returned.
    This method may be overwritten by subclasses.

    method

    toString

    Returns string

Static deferredDestroy

  • _deferredDestroy(): void

Static deserialize

  • deserialize(data: any): any

Generated using TypeDoc