Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

dynamic src - error when stop casting #9

Closed
mattsobo opened this issue May 5, 2016 · 2 comments
Closed

dynamic src - error when stop casting #9

mattsobo opened this issue May 5, 2016 · 2 comments

Comments

@mattsobo
Copy link

mattsobo commented May 5, 2016

If I load the player via the following:

videojs("example_video_1", config).ready(function() {
    vjsPlayer = this;
    vjsPlayer.chromecast.options.appId = "APP-ID";
    vjsPlayer.src( [
            { type: "video/webm", src: "http://vjs.zencdn.net/v/oceans.webm" },
            { type: "video/mp4", src: "http://vjs.zencdn.net/v/oceans.mp4" },
            { type: "video/ogg", src: "http://vjs.zencdn.net/v/oceans.ogv" }
        ]);
    vjsPlayer.play();
});

The error occurs because this.player_.options_['sources'] is empty. My video tag has no sources defined as these are loaded dynamically via the script. Can the src also be queried to get a list of videos? Also, this.player_.currentTime() returns 0 no matter where the playback is.

key: 'onStopAppSuccess',
value: function onStopAppSuccess() {
    this.casting = false;
    var time = this.player_.currentTime();
    this.removeClass('connected');
ERROR//-->  this.player_.src(this.player_.options_['sources']); <--// ERROR
    if (!this.player_.paused()) {
        this.player_.one('seeked', function () {
            return this.player_.play();
@chemoish
Copy link

@benjipott any update? Is this being maintained?

this.player_.options_['sources'] probably should be rewritten to this.player().currentSrc() so you aren't accessing "private" variables. However, that will only get the previously active source.

Also, the this.player_.options_['sources'] is only generated via the Player.getTagSettings() method that is called in the constructor. So dynamic sources would be impossible to retrieve.

Complex sources aren't even available in video.js, but I have had an outstanding pull request for those features.

SEE: videojs/video.js#2678

@gabehayes
Copy link
Contributor

#14 should address this particular issue.

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

No branches or pull requests

4 participants