Message plugin demo
This demo demonstrates the message plugin. The plugin allows you to show custom messages
When playing the video you should see a greeting in the beginning and in the end of the video.
Sample implementation
var player = window.player = flowplayer("#player", {
src: "//edge.flowplayer.org/bauhaus.mp4"
, title: "native / message"
})
player.on(flowplayer.events.PLAYING, function () {
player.emit(flowplayer.message.events.SHOW_MESSAGE, {
message: "Hello there!",
timeout: 5000
})
})
player.on("ended", function () {
player.emit(flowplayer.message.events.SHOW_MESSAGE,
{ message: "Bye bye!"
, sticky: true
}
)
});
Libraries
<!-- <head> -->
<link rel="stylesheet" href="//cdn.flowplayer.com/releases/native/3/stable/style/flowplayer.css" />
<!-- <body> -->
<script src="//cdn.flowplayer.com/releases/native/3/stable/flowplayer.min.js"></script>
<script src="//cdn.flowplayer.com/releases/native/3/stable/plugins/message.min.js"></script>
HTML code
<div id="player"></div>
Javascript
var player = flowplayer("#player", {
token: "eyJraWQiOiJxaEZ6dWR4dmJuTDMiLCJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJjIjoie1wiYWNsXCI6NixcImlkXCI6XCJxaEZ6dWR4dmJuTDNcIixcImRvbWFpblwiOltcImZsb3dwbGF5ZXIuY29tXCJdfSIsImlzcyI6IkZsb3dwbGF5ZXIifQ.pdpIEfbRN_6P-ayyNsEazPPPjr0RSmd8SjJyqp8w8BYXTYsg11FjCODutzLZ6jkSm5hHTqfg05cCVuHcFIfI1w"
, src: "//edge.flowplayer.org/bauhaus.mp4"
, title: "native / message"
})
// show a message when playback started
player.on(flowplayer.events.PLAYING, function () {
player.emit(flowplayer.message.events.SHOW_MESSAGE, {
// we override the default of 3 seconds and show the message for 5
timeout: 5000,
message: "Hello there!"
})
})
// show a message when playback ended
player.on("ended", function () {
player.emit(flowplayer.message.events.SHOW_MESSAGE,
{ message: "Bye bye!"
, sticky: true
}
)
})
Use your own token when adapting this.