Detecting the end of video using OSMPlayer


Hits: 2879  

I was working on video ads solution using OSMPlayer. So, It was needed to detect video finish event in OSMPlayer …

The Open Standard Media Player (OSMPlayer) is an all-in-one video player. It is open source (MIT) video player for web media, including Red5, Wowza, HTML5, YouTube, Vimeo, Limelight CDN, Kaltura, and Flash.

I have onComplete() method in JavaScript… but I was not sure how to bind video ended event in this JavaScript API …

<script type="text/javascript">
  $(function() {
    $("video").osmplayer({
      width: '100%',
      height: '600px'
    });
  });

$(function() {
        minplayer.get(‘media’, function(media) { 
        media.bind(‘ended’, function() {
       //The video is done!
       alert(“video complete :)”);
});
});
});

</script>

<video src="VIDEO-SOURCE" poster="VIDEO-POSTER-IMAGE"></video>

Thanks to Travis Tidwell

Published by

Sandeep Verma

I’m an Entrepreneur. I’m proud to work as Blogger, LAMP Programmer, Linux Admin, Web Consultant, Cloud Manager, Apps Developer, Searcher. Concentrate > Observe > Imagine > Launch

28 thoughts on “Detecting the end of video using OSMPlayer”

  1. I have been surfing online greater than three hours today, but I never
    found any attention-grabbing article like yours.
    It’s pretty price sufficient for me. In my opinion, if all webmasters and bloggers made excellent content material as
    you probably did, the web will be much more useful than ever before.

  2. Hi there to every body, it’s my first pay a quick visit of this
    weblog; this website consists of remarkable and really
    fine material in favor of readers.

  3. My coder is trying to convince me to move to .net from PHP.
    I have always disliked the idea because of the expenses.
    But he’s tryiong none the less. I’ve been using Movable-type on several websites
    for about a year and am anxious about switching to another platform.
    I have heard very good things about blogengine.net.
    Is there a way I can import all my wordpress posts into it?
    Any help would be really appreciated!

  4. It’s perfect time to make some plans for the future and
    it is time to be happy. I have read this post and if I could I wish to suggest you few
    interesting things or advice. Maybe you could write next
    articles referring to this article. I wish to read even more things about it!

  5. An interesting discussion is worth comment. There’s no doubt that that
    you should write more on this topic, it might not be a
    taboo matter but typically people do not discuss these topics.
    To the next! Many thanks!!

  6. You really make it seem so easy with your presentation but I find
    this topic to be actually something which I think I would never understand.

    It seems too complex and very broad for me. I’m looking forward for your next
    post, I’ll try to get the hang of it!

  7. I’m truly enjoying the design and layout of your blog. It’s a very easy on the eyes which makes it much more
    enjoyable for me to come here and visit more often. Did you
    hire out a developer to create your theme? Excellent work!

  8. This is the perfect site for anyone who wants to understand this topic.
    You understand a whole lot its almost tough to argue with you (not that I actually will need to…HaHa).
    You definitely put a fresh spin on a subject which has been written about
    for years. Wonderful stuff, just wonderful!

  9. Hi, Neat post. There is a problem together with
    your web site in internet explorer, would test this? IE
    nonetheless is the market chief and a huge section of other people will omit your wonderful writing
    due to this problem.

  10. I’m amazed, I have to admit. Rarely do I encounter a blog that’s both educative and interesting,
    and let me tell you, you have hit the nail on the head.
    The problem is something which too few people are speaking
    intelligently about. I’m very happy that I stumbled across this in my hunt for something relating to this.

  11. This is the perfect blog for anyone who wishes
    to understand this topic. You realize so much its almost tough to argue with you (not that I really
    would want to…HaHa). You certainly put a new spin on a topic that has been written about for years.
    Excellent stuff, just wonderful!

  12. I blog quite often and I really appreciate your content.
    Your article has really peaked my interest. I will book mark your website and keep checking for
    new details about once a week. I opted in for your Feed
    as well.

  13. Hi there, I discovered your web site by the use of Google while looking for
    a similar matter, your web site came up, it appears to be like great.
    I have bookmarked it in my google bookmarks.

    Hi there, just became alert to your blog thru Google,
    and located that it’s really informative. I’m gonna watch out for brussels.

    I will be grateful for those who continue this in future.
    A lot of folks can be benefited out of your writing. Cheers!

Leave a Reply

Your email address will not be published.

*