new WebVideo(filename)
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| filename | string | Filepath to the video | 
Extends
Methods
containsPoint(x, y) → {boolean}
    Checks if the passed point is contained in the WebVideo.
- Overrides:
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| x | number | The x coordinate of the point being tested. | 
| y | number | The y coordinate of the point being tested. | 
Returns:
- Type:
- 
        
boolean
    Whether the passed point is contained in the WebVideo.
    
draw(__graphics__)
    Draws the WebVideo in the canvas.
- Overrides:
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| __graphics__ | CodeHSGraphics | Instance of the __graphics__ module. | 
getBorderWidth() → {number}
    Gets the width of the Thing's border.
- Inherited From:
- Source:
Returns:
- Type:
- 
        
number
    The width of the Thing's border.
    
getHeight() → {number}
    Gets the height of the WebVideo.
- Source:
Returns:
- Type:
- 
        
number
    Height of the WebVideo.
    
getType() → {type}
    Returns the type of a Thing.
- Inherited From:
- Source:
Returns:
- Type:
- 
        
type
    The type of the Thing.
    
getWidth() → {number}
    Gets the width of the WebVideo.
- Source:
Returns:
- Type:
- 
        
number
    Width of the WebVideo.
    
getX() → {number}
    Gets the x position of the Thing.
- Inherited From:
- Source:
Returns:
- Type:
- 
        
number
    The x position of the Thing.
    
getY() → {number}
    Gets the y position of the Thing.
- Inherited From:
- Source:
Returns:
- Type:
- 
        
number
    The y position of the Thing.
    
hasBorder() → {boolean}
    Returns if a Thing has a border.
- Inherited From:
- Source:
Returns:
- Type:
- 
        
boolean
    True if the Thing has a border.
    
isFilled() → {boolean}
    Returns if a Thing is filled.
- Inherited From:
- Source:
Returns:
- Type:
- 
        
boolean
    True if the Thing is filled.
    
isMuted() → {boolean}
    Returns whether the WebVideo is currently muted.
- Source:
Returns:
- Type:
- 
        
boolean
    True if the video is muted, false if it is not.
    
isPlaying() → {boolean}
    Returns whether the WebVideo is currently playing.
- Source:
Returns:
- Type:
- 
        
boolean
    True if the video is playing, false if it is not.
    
move(dx, dy)
    Changes the possition of a thing by a specified x and y amount.
- Inherited From:
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| dx | number | The resulting change in the Thing's x position. | 
| dy | number | The resulting change in the Thing's y position. | 
onReadyToPlay(fn)
    Defines a function to call once the video has loaded enough and is ready to play.
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| fn | function | A function to call when the video is ready to play. | 
rotate(degrees, angleUnit)
    Rotates a Thing an additional amount of degrees.
- Inherited From:
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| degrees | number | The degrees to rotate degrees. | 
| angleUnit | number | Whether it is degrees or radians. Defaults to degrees. | 
setAutoplay(autoplay)
    Sets whether the WebVideo should start playing automatically once loaded.
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| autoplay | boolean | True/false whether the video should start playing automatically. | 
setBorder(hasBorder)
    Sets a Thing object to filled.
Throws an error if an argument is not passed.
- Inherited From:
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| hasBorder | bool | A boolean of whether or not Thing has a border. | 
setBorderColor(color)
    Sets the border color of a Thing.
Throws an error if there are fewer than 1 params or if
the param is undefined.
- Inherited From:
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| color | Color | The resulting color of the Thing's border. | 
setBorderWidth(width)
    Sets the width of a Thing's border.
Throws an error if there is not 1 argument.
- Inherited From:
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| width | number | The resulting width of the Thing's border. | 
setColor(color)
    Sets the color of a Thing.
Throws an error if there are fewer than 1 params or if
the param is undefined.
- Inherited From:
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| color | Color | The resulting color of Thing. | 
setFilled(filled)
    Sets a Thing object to filled.
Throws an error if an argument is not passed.
- Inherited From:
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| filled | bool | A boolean of whether or not Thing is filled. | 
setLoop(loop)
    Sets whether the WebVideo should loop and play again once finished.
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| loop | boolean | True/false whether the video should loop. | 
setMuted(muted)
    Sets whether the WebVideo is muted or not.
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| muted | boolean | True/false whether the video should be muted. | 
setPosition(x, y)
    Sets the position of a Thing.
Throws an error if there are fewer than 2 params or if
they are not numbers.
- Inherited From:
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| x | number | The destination x coordinate of this Thing. | 
| y | number | The destination y coordinate of this Thing. | 
setRotation(degrees, angleUnit)
    Sets the rotation of a Thing in degrees.
Throws an error if there are fewer than 1 params or if they
are not numbers.
- Inherited From:
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| degrees | number | The degrees to rotate degrees. | 
| angleUnit | number | Whether it is degrees or radians. Defaults to degrees. | 
setSize(width, height)
    Sets the size of the WebVideo.
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| width | number | The desired width of the resulting WebVideo. | 
| height | number | The desired height of the resulting WebVideo. | 
setType(type)
    Sets a Thing object's type.
Questionable of whether or not this method is used.
- Inherited From:
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| type | type | A type to set the Thing to. |