I have implemenetd osm player. I need to customize it. ie When clicking a button (button provided by osm palyer) I need to pause it. How can I do this?
<script type="text/javascript">
var myplayer = "";
myplayer = $(function() {
$("video").osmplayer({
width: '100%',
height: '600px'
});
$("button").click(function() {
myplayer.stop();
})
});
</script>
<video src="http://progressive.totaleclips.com.edgesuite.net/105/e105598_257.mp4" poster="http://www.movieposter.com/posters/archive/main/143/MPW-71686"></video>
What you will want to do is pause the underlying video tag. so to do that, you will need to get var video = $('video')[0]
or give it an id and get it with var video = $('#id-of-video')
then just do video.pause();
you can do this in one step like so:
$('video')[0].pause();
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.