Submit an Issue Fork on GitHub
VideoCocoon comes with multiple files that can be loaded asynchronously:
Alternatively, you may include a bundled version in your project.
Define the HTML object to be used as the target for the iFrame embed (The target
option defaults to <body/>
):
Utilize the VideoCocoon.init
method to create a new player.
VideoCocoon.init
will return a player object. This object can be referenced to interact with the player:
target
(String | Node) - Default <body/>
src
(String)
src
option can also be implemented via a data-src
attribute on the target
elementclass
(Object)
frame
(String)
events
(Object)
params
(Object)
Methods are registered directly on the player object.
play
pause
stop
seek
toggle
on(name, callback)
trigger(name)
Native provider methods can be accessed from the player
property of the player object:
Callbacks are registered on a player object via the events property. The player object is set as the scope for callback events.
VideoCocoon events:
onApiLoaded
onFrameEmbed
onPlayerInitialized
API provider native events:
A player object instance is returned when initializing a video via the VideoCocoon.init
method. All the player instances are stored in the players
property of the VideoCocoon
object (VideoCocoon.players
).
Refer to the methods section to see available methods on a player instance.
Other properties available on a player instance:
The following references were used for API implementations
Currently supported video providers include
Refer to the [video provider documentation](src/script/provider) for information regarding implementing a new video provider.
VideoCocoon is licensed under the MIT License. Go wild and make awesome things :)