简体   繁体   中英

How to get alert message when a play button is clicked in jwplayer 5?

I am working on omniture site catalyst variables to be placed for video tracking for a client. My problem is when we click on jwplayer play button i want to throw a alert message. Can anybody please advise me how to do this one.

Here is a quick sample!

<html>
<head>
<title>Test Page</title>
</head>
<body>
<script type="text/javascript" src="http://player.longtailvideo.com/jwplayer.js"></script>
<div id="player"></div>
<script type="text/javascript">
    jwplayer("player").setup({
            file: "http://www.longtailvideo.com/jw/upload/bunny.mp4",
            image: "http://www.longtailvideo.com/jw/upload/bunny.jpg",
            flashplayer: "http://player.longtailvideo.com/player.swf",
            height: 300,
            width: 465,
            events:{
                onPlay: function(event) {
                    alert('Playing!');
                }
            }
    });
</script>
</body>
</html>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM