Coder Social home page Coder Social logo

Comments (8)

johndyer avatar johndyer commented on May 19, 2024

Could you show me how you're using the play and pause methods? In an updated version, I'm also making those methods public on the MediaElementPlayer object which might make it easier.

from mediaelement.

tforster avatar tforster commented on May 19, 2024

When the user rolls over the video when it's not playing a strip of thumbnails is displayed along the bottom just above the scrub bar. The opacity and background colour are the same as the scrub bar so it looks like it's part of the player controls.

The strip of thumbnails represent a playlist and a click on any of the thumbnails should load and play the associated video. I can toggle playing of HTML5 H.264 videos but not Flash H.264. I'm using $("video")[0].play() and $("video")[0].pause().

This is on my local dev server so I don't have an exposed endpoint that I can open right now otherwise I would invite you to see it directly.

from mediaelement.

johndyer avatar johndyer commented on May 19, 2024

Unfortunately, there's no way to make the browsers work quite like that. Here's the syntax you should use:

// create the player object explicitly, not via jQuery().mediaelementplayer()
var player = new MediaElementPlayer('myvideid');

// call methods on the internal media object (you can leave off the .media in the latest code)
player.media.setSrc('mynewvideo.mp4');
player.media.load();
player.media.play();

Hope that helps!

from mediaelement.

tforster avatar tforster commented on May 19, 2024

John, thanks for replying so quickly. It's greatly appreciated. I will try your code tomorrow morning. Meanwhile, when you say there's no way to make the browsers work like that do you mean the browsers or the (flash) plugin? If I open a webkit console on your mediaelementjs.com page and execute $("video")[0].play() it starts the video. Correspondingly a .pause() halts it.

from mediaelement.

johndyer avatar johndyer commented on May 19, 2024

I mean there is no way to get $("video")[0].play() to work in all browsers the same way since they don't support the same features.

Since webkit supports native H.264 playback, $("video")[0].play() will work. However, on IE8 which doesn't support the [video] tag $("video")[0].play() isn't available, and on Firefox which can't play H.264, $("video")[0].play() will fail.

from mediaelement.

tforster avatar tforster commented on May 19, 2024

Do'h! It's clear now. I'm still referencing the video element not the resulting mediaelement object :) It was a long day yesterday.

Thanks John and thank you for an awesome plugin too.

from mediaelement.

johndyer avatar johndyer commented on May 19, 2024

Feel free to re-open this if you need to.

from mediaelement.

clemmonsmc avatar clemmonsmc commented on May 19, 2024

Using the above method, I am still unable to play an H.264 video on Firefox via a click method. Is the behavior I am see unexpected?

Here is my code:

var vp = new MediaElementPlayer('#video-player');
var tp = new MediaElementPlayer('#tour-player');

$('div.tabs ul.tabNavigation a[href="#video"]').click(function() {
   tp.pause();
   vp.load();
   vp.play();
});

$('div.tabs ul.tabNavigation a[href="#tour"]').click(function() {
   vp.pause();
   tp.load();
   tp.play();
});

from mediaelement.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.