Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching between sources with diffrenet technologies causes problem #882

Closed
ahmadazimi opened this issue Dec 8, 2013 · 16 comments
Closed

Comments

@ahmadazimi
Copy link

In my case this is the techOrder:

techOrder : ['html5', 'flash']

everything works fine while I'm using file types which are supported by Html5 tech, however as soon as I pass on a file type which is not supported by html5 and it requires the tech to be switched to Flash everything start acting weird for example the play progress bar doesn't work anymore or the currrentTime always stays on zero.

My best guess here is that Flash player couldn't trigger events anymore.

@heff
Copy link
Member

heff commented Dec 10, 2013

When you change the source are you including the type information? e.g. player.src({ src="...", type="video/mp4" });

@ahmadazimi
Copy link
Author

@heff : Yes, I've also included the type for the new video but when the new video start playing the currentTime stays zero!
I've found that after changing tech, Flash always returns zero for currentTime, so the player starts acting weird!

@mmcc
Copy link
Member

mmcc commented Dec 17, 2013

Can you give us a reduced test case using something like JSBin?

@ahmadazimi
Copy link
Author

@mmcc : I couldn't run my test case on JSBin, so I've uploaded that on another server: http://w3group.org/videojs.html

Please wait until player start playing, then click on Change Source 1 link and then click on Change Source 2 link.
Take a look at current time, total time and progress bar to see what happened!
And sometimes the control bar wont hide, although the mouse goes out of the movie.

Here is the js:

var player;

$(document).ready(function() {
    player = videojs('my_video_1', {
        techOrder: ['flash', 'html5'],
        autoplay: true,
        sources: [{ 
            type: "video/flv",
            src: "http://www.longtailvideo.com/jw/upload/bunny.flv"
        }]
    });


    $('a.one').on('click', function() {
        changeSource({ 
            type: "video/webm",
            src: "http://upload.wikimedia.org/wikipedia/mediawiki/d/d1/Wikipedia_on_Google_Glass_screencast_test.webm"
        });
    });

    $('a.two').on('click', function() {
        changeSource({ 
            type: "video/flv",
            src: "http://www.mediacollege.com/video-gallery/testclips/20051210-w50s_56K.flv"
        });
    });
});

function changeSource(src) {
    player.pause();
    player.currentTime(0);

    player.src(src);

    player.ready(function() {
        this.one('loadeddata', videojs.bind(this, function() {
            this.currentTime(0);
        }));

        this.load();
        this.play();
    });
}

@mmcc
Copy link
Member

mmcc commented Mar 4, 2014

Sorry for the delay! I just confirmed, this is still a problem as of 4.4.2, so we'll look into it. Here's a JS Fiddle with updated VJS includes for future testing.

@triwav
Copy link

triwav commented Aug 18, 2014

Just wanted to chime in that this isn't just going from HTML5 to Flash. I'm using this plugin:
https://github.com/benjipott/video.js-chromeCast
which sets up it's own playback tech and when done if you switch back to flash it doesn't work. If you instead use the HTML5 player everything works as expected.

@mmcc
Copy link
Member

mmcc commented Aug 27, 2014

@triwav so to clarify, you're saying it's switching from any tech to Flash? I think there are actually some related issues open, but I can't think of them off the top of my head.

@triwav
Copy link

triwav commented Aug 27, 2014

Can't say for certain if it's EVERY single one but just saying both on HTML5 to Flash as well as the chromecast plugin tech to Flash both cause this issue. 4.7.2 mentions Fixed a case where timeupdate events were not firing, and fixed and issue with the Flash player version. I haven't tried it on that or newer yet. I'll try to test in the coming week and report if it's indeed solved.

@philipgiuliani
Copy link
Contributor

@triwav have you already found a solution for this? Im currently fixing it in kim-company/videojs-chromecast#5

@triwav
Copy link

triwav commented Sep 22, 2014

@philipgiuliani I haven't had a chance to look into this yet. Any fix would be appreciated. I have made some changes to build additional functionality. Not sure if you're trying to make your change solely for this issue or if you'd be interested in building in some additional functionality.

@philipgiuliani
Copy link
Contributor

@triwav i will built in some additional functionality. Already added some new features. Take a look if you want to support it. The master is currently only tested with Video.JS 4.3.

@triwav
Copy link

triwav commented Sep 22, 2014

Considering the original author hasn't done anything with the plugin, it looks like you might be the only one to move things forward. If you PM your email I can send you my current version of the file. I don't have the time to push changes unfortunately though.

@philipgiuliani
Copy link
Contributor

Its possible to send PM's over GitHub?
E-Mail: giiuliio@gmail.com

@mmcc
Copy link
Member

mmcc commented Sep 22, 2014

@triwav other people might be interested. Mind putting it in a gist and linking from here?

@philipgiuliani
Copy link
Contributor

@mmcc he hasn't found a solution for this yet, and me neither :( He just sent me a copy because he had fixed some other bugs out from the plugin.

I will also take a look and report as soon as i found a solution.

@mmcc
Copy link
Member

mmcc commented Jul 25, 2015

Pretty sure this is closed by #2125, but if not ping this thread and we'll reopen.

@mmcc mmcc closed this as completed Jul 25, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants