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

Cannot play videos in a playlist with non-youtube videos #47

Open
degrov opened this issue Dec 28, 2015 · 1 comment
Open

Cannot play videos in a playlist with non-youtube videos #47

degrov opened this issue Dec 28, 2015 · 1 comment

Comments

@degrov
Copy link

degrov commented Dec 28, 2015

Seems the plugin code overrides "mediaelement" functions without reverting back to original functions on video complete. This causes problem when trying to play the next non-youtube video by changing videogular source.

    API.mediaElement[0].__defineGetter__("duration", function () {
        return ytplayer.getDuration();
    });

    API.mediaElement[0].__defineGetter__("currentTime", function () {
        return ytplayer.getCurrentTime();
    });

    API.mediaElement[0].__defineSetter__("currentTime", function (seconds) {
        return ytplayer.seekTo(seconds, true);
    });
...
    API.mediaElement[0].play = function () {
        ytplayer.playVideo();
    };
    API.mediaElement[0].pause = function () {
        ytplayer.pauseVideo();
    };
...
@appyapp
Copy link

appyapp commented Aug 24, 2016

Hi,

I have the same problem. In Firebug, the log of the error is the following:
Error: this.a is null g.C@https://s.ytimg.com/yts/jsbin/www-widgetapi-vflpJ8svn/www-widgetapi.js:100:77 Q@https://s.ytimg.com/yts/jsbin/www-widgetapi-vflpJ8svn/www-widgetapi.js:92:97 Ob/</this[a]@https://s.ytimg.com/yts/jsbin/www-widgetapi-vflpJ8svn/www-widgetapi.js:134:124 onVideoReady/API.mediaElement[0].play@http://localhost:8031/js/lib/videogular/youtube.js:104:33 this.play@http://localhost:8031/js/lib/videogular/videogular.js:431:13 this.playPause@http://localhost:8031/js/lib/videogular/videogular.js:413:17 onClickOverlayPlay@http://localhost:8031/js/lib/videogular/vg-overlay-play.js:59:25 anonymous/fn@http://localhost:8031/js/lib/angular.min.js line 231 > Function:2:242 b@http://localhost:8031/js/lib/angular.min.js:126:19 Kc[b]</<.compile/</</e@http://localhost:8031/js/lib/angular.min.js:274:195 uf/this.$get</m.prototype.$eval@http://localhost:8031/js/lib/angular.min.js:145:103 uf/this.$get</m.prototype.$apply@http://localhost:8031/js/lib/angular.min.js:145:335 Kc[b]</<.compile/</<@http://localhost:8031/js/lib/angular.min.js:274:245 r.event.dispatch@http://localhost:8031/js/lib/jquery.min.js:3:9870 r.event.add/q.handle@http://localhost:8031/js/lib/jquery.min.js:3:7932

I do the same analysis. The youtube player is destroyed but the function onVideoReady() of the plugin is called and the API.mediaElement is altered.

Did you find a solution ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants