Coder Social home page Coder Social logo

video.js-chromecast's Introduction

DEPRECATION WARNING: Unfortunately it's time for me to deprecate this library as I cannot give it the time it needs. If you're interested in maintaining this lib, send me message ([email protected]). I'd recommend using something like chromeless or puppeteer if possible. Thanks!

Build Status

Donate

Chromecast Plugin for video.js 5.*

Alt text

Installation

Install videojs-chromecast via npm (preferred):

$ npm install videojs-chromecast

Or Bower:

$ bower install videojs-chromecast

Inclusion

Include videojs-chromecast on your website using the tool(s) of your choice.

The simplest method of inclusion is a <script> tag after the video.js <script> tag:

<head data-cast-api-enabled="true"> <!-- allow chromecast extention -->
<script src="http://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script> <!-- add chromecast sdk -->
<script src="path/to/video.js/dist/video.js"></script><!-- add video.js sdk -->
<script src="path/to/videojs-chromecast/dist/videojs-chromecast.js"></script><!-- add plugin -->

When installed via npm, videojs-chromecast supports Browserify-based workflows out of the box.

Basic Usage

For full details on how to use chromecast in the API documentation.

var player = videojs('video',{
  chromecast:{
     appId:'APP-ID'
  }
});

Options

Chromecast sdk mediaInfo use poster image

options :{
  chromecast:{
     appId:'APP-ID',
     metadata:{
       title:'Title display on tech wrapper',
       subtitle:'Synopsis display on tech wrapper',
     }
  }
}

License

Apache-2.0. Copyright (c) Benjipott, Inc.

video.js-chromecast's People

Contributors

amilajack avatar benjipott avatar bregnholm avatar danotrilogic avatar gabehayes avatar iencotech avatar tmm1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

video.js-chromecast's Issues

HLS livestream with infinity not playing from live

We've got a livestreaming service using this plugin. A problem we encountered is that our livestream has got a length of 1 hour, and when casting one of our livestreams the Chromecast won't start the playback from live.

Is there a way to fix this?

How do you set chromecast options?

How do you set the appId and metadata for this plugin ?

Whenever i try using player.chromecast(); i get the error message that Uncaught TypeError: player.chromecast is not a function.

if i try and add player.chromecast.options.appId = "APP-ID";
i just get a random Generated ID.

Some guidance with this would be much appreciated.

[Fix activeTrackIds] Set the selected subtitle active before casting

Substitles are never casted even if selected in videojs
Adding this piece of code automatically sets the active trackId before casting

Place this code between line 251 and 252 in chromecast.js

var activeTrack = 0
document.querySelectorAll('.vjs-menu-content > .vjs-captions-menu-item').forEach(function(el, i) {
     if (el.classList.contains('vjs-selected')) {
          activeTrack = (i + 1)
     }
})
loadRequest.activeTrackIds = [activeTrack];

LOAD_FAILED

Hello,

I can't seem to get my casting to work.

VIDEOJS: Cast APIs are available
VIDEOJS: Cast video: https://redirector.googlevideo.com/videoplayback?id=350171769f811a5f...
VIDEOJS: Session initialized: 8b99982a-e4e7-4d0e-8b48-9ed094e06d8c source : https://redirector.googlevideo.com/videoplayback?id=350171769f811a5f...
VIDEOJS: Cast Error: {"code":"session_error","description":"LOAD_FAILED","details":{"type":"LOAD_FAILED"}}

It looks like it may have something to do with CORS, since the video from your "index.html" is playing perfectly. And the videos from googlevideo,com domain doesn't allow Cross Origin by default.

Is there anything I can do, or am I just plain out of luck?

Failed to execute 'addCue' on 'TextTrack': parameter 1 is not of type 'TextTrackCue'

Hi,

When a user stops to cast an HLS stream with captions, Chrome raises an exception:

Uncaught TypeError: Failed to execute 'addCue' on 'TextTrack': parameter 1 is not of type 'TextTrackCue'.
    at https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/video.js:18160:27
    at Array.forEach (native)
    at https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/video.js:18159:18
    at Array.forEach (native)
    at Object.jsonToTextTracks (https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/video.js:18156:8)
    at Player.loadTech_ (https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/video.js:10687:49)
    at Player.sourceList_ (https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/video.js:12111:14)
    at Player.src (https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/video.js:12046:12)
    at ChromeCastButton.onStopAppSuccess (https://rawgit.com/benjipott/video.js-chromecast/2.0.7/dist/videojs-chromecast.js:280:26)
    at Y.e.bd (chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/cast_sender.js:87:473)

It's very easy to repeat here:
http://www.w3schools.com/code/tryit.asp?filename=F09KO2XJN00D

Steps:

  1. start playback
  2. start casting, wait for playback on Chromecast
  3. stop casting
  4. notice an exception in Chrome console

As a result player fails to switch from cast tech back to html5 tech.
Any help is appreciated.

dynamic src - error when stop casting

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();

Load video with javascript

If i load a video the videojs way with javascript. it won't work.
We should disconnect from Chromecast, load the video with javascript and restart Chromecast.

Send mp4 files through PHP script

Hi,

I'm sending mp4 files through php script (yes all needed headers are here for example content-type video/mp4) but when I want to play it with your plugin to chromecast there's error:

VIDEOJS: Cast APIs not available video.js:23329 VIDEOJS: Cast APIs not available. Max reconnect attempt video.js:23329 VIDEOJS: Cast APIs are available video.js:23329 VIDEOJS: Cast video: https://subdomain.domain.com/vipvideo.php?vid=id&type=subtitles video.js:23329 VIDEOJS: Session initialized: 536c8964-45e7-4003-a10c-c2328d8e5fae source : https://subdomain.domain.com/vipvideo.php?vid=id&type=subtitles type : video/mp4 video.js:23329 VIDEOJS: Cast Error: {"code":"session_error","description":"LOAD_FAILED","details":{"type":"LOAD_FAILED"}}

Why? It's because something wrong on my side (but it's playing in browser) or it can't be passed through php by chromecast itself?
How chromecast works? Because to play this videos people should be logged etc. so when I'm logged in browser it should work, right? I don't need any additional sessions for chromecast?

Clicking icon while casting results in error

When I click the cast icon while it is casting, the video becomes unplayable and I get the following error:
VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) No compatible source was found for this media.

In comparison, YouTube will show the cast toolbar:
cast toolbar

Crash on chrome based browsers

Hi,

I am facing a problem using Samsung Internet browser. Since it is a chrome based browser, VideoJS detects it as Chrome and the plugin tries to load the casting functionality, however I get a JS error saying that "chrome is not defined", breaking javascript execution and not being able to use VideoJS at all.

In order to fix this problem, the code could be added a check to not continue if the global variable chrome is not defined.

The intention of this fix would not be to make casting work for these browsers, rather would be about fixing the plugin to not crash on these type of browsers when using the plugin.

Thanks very much!

Tablets and Smartphones

When viewing my website through a Tablet or Smartphone, the video-js appears diffrent and the cast button does not appear.
Any clue to why and how it can be solved?

Thanks

conflict with custom controlbar button

Hi,

I have a custom controlbar, and a custom button for settings. I have included the plugin files but the plugin does not initiate, unless I remove the controlbar's code.

doesn't work (please ignore the twig lines)

var options = {
            html5: {
                hls: {
                    {% if is_android_os() %}
                    overrideNative: true,
                    withCredentials: false,

                    {% else %}
                    nativeAudioTracks: false,
                    nativeVideoTracks: false,
                    {% endif %}
                }

            },
            preload: 'auto',
            bigPlayButton: false,
            errorDisplay: false,
            playbackRates: [0.5, 1, 1.5, 2],
            plugins: {
                chromecast: {}
            },
            controlBar: {
                volumeMenuButton: {
                    vertical: true,
                    inline: false,
                    volumeBar: {
                        vertical: true
                    },
                    volumeLevel: true
                },

                children: [
                    {
                        name: 'playToggle'
                    },
                    {
                        name: 'button'
                    },
                    {
                        name: 'volumeMenuButton'
                    },
                    {
                        name: 'currentTimeDisplay'
                    },
                    {
                        name: 'progressControl'
                    },
                    {
                        name: 'durationDisplay'
                    },
                    {
                        name: 'captionsButton'
                    },
                    {
                        name: 'fullscreenToggle'
                    },
                ],
                liveDisplay: false,
                audioTrackButton: false,
                captionsButton: true,
                chaptersButton: false,
                descriptionsButton: false,
                subtitlesButton: false,
                currentTimeDisplay: true,
                playbackRateMenuButton: false
            },


        }

        var player = videojs('content_video', options);

this works

 var options = {
            html5: {
                hls: {
                    {% if is_android_os() %}
                    overrideNative: true,
                    withCredentials: false,

                    {% else %}
                    nativeAudioTracks: false,
                    nativeVideoTracks: false,
                    {% endif %}
                }

            },
            preload: 'auto',
            bigPlayButton: false,
            errorDisplay: false,
            playbackRates: [0.5, 1, 1.5, 2],
            plugins: {
                chromecast: {}
            },
            controlBar: {
                volumeMenuButton: {
                    vertical: true,
                    inline: false,
                    volumeBar: {
                        vertical: true
                    },
                    volumeLevel: true
                },
                liveDisplay: false,
                audioTrackButton: false,
                captionsButton: true,
                chaptersButton: false,
                descriptionsButton: false,
                subtitlesButton: false,
                currentTimeDisplay: true,
                playbackRateMenuButton: false
            },


        }

        var player = videojs('content_video', options);

I'm relatively new to this player, so what am I doing wrong? I'm using videojs version 5.11.7.

API Documentation Blank

Hi there,

Looking to utilize this in a project of mine, but the API documentation is completely blank. Any chance of this being updated soon with documentation?

Regards,

-TC

Plugin not initiating or something?

Been trying to get this to work.

Used dist from chromecast and video.js(5.20.*) which came with the project.

Loaded the files in the given order, also imported css file into the header.

Initiated videojs on my video#mediaplayer.

However the player is not initiated. I cant start any video nor see anything else than this in console:

VIDEOJS: Cast APIs not available video.js:23328 VIDEOJS: Cast APIs not available. Max reconnect attempt video.js:23328 VIDEOJS: Cast APIs are available

This is my script:
var player = videojs('mediaplayer',{ chromecast:{} });

Subtitles? .vtt

Does anyone know how to stream .vtt or .srt to chromecast with this plugin? I tried about anything but it doesn't work when casting..

DRM support

Hi,

Is it possible to watch DRM content like DASH with Widevine?

Thanks.

videojs chromecast-hls not working

I have tried many times but I cant get videojs to work with hls and chromecast.

Can anybody show some code or an example? Please

Thanks

Video.js 7.x compatibility

Hi, it would be great to make this plugin compatible with Video.js 7.x versions.

When loading the plugin with Video.js 7.0.3 I get this error:

video.js:4554: Illegal component, "Chromecast"; techs must be registered using Tech.registerTech().
at Function.registerComponent (video.js:4554)
at Object. (videojs-chromecast.min.js:7)
at Object.2 (videojs-chromecast.min.js:7)
at n (videojs-chromecast.min.js:7)
at videojs-chromecast.min.js:7
at Object. (videojs-chromecast.min.js:7)
at Object.3../component/control-bar/chromecast-button (videojs-chromecast.min.js:7)
at n (videojs-chromecast.min.js:7)
at videojs-chromecast.min.js:7
at Object. (videojs-chromecast.min.js:7)

Is this upgrade possible ? Thanks

M3U8 playlist

Hi I'm not able to work this chromecast plugin with m3u8 playlist.

Can be possible?

Thanks

When we stop Chromecast the video cannot play after

When we stop Chromecast the video cannot play in Video.js after.

Error after sending video to Chromecast. (I think the plugin should pause de video right after click chromecast button to load faster and not wait Chromecast player to be playing)

videojs-chromecast.min.js:7 Uncaught TypeError: c.default.createEl is not a function
    at t.value (videojs-chromecast.min.js:7)
    at t.Component (video.js:3050)
    at t.Tech (video.js:14745)
    at new t (videojs-chromecast.min.js:7)
    at Player.loadTech_ (video.js:9578)
    at t.value (videojs-chromecast.min.js:7)
    at cast_sender.js:82
    at cast_sender.js:83
    at V.onMessage (cast_sender.js:88)
    at O.h (cast_sender.js:62)

Error after stoping video from the Chromecast button. (For HLS Video or other Tech)

Uncaught TypeError: this.tech_[method] is not a function
    at Player.techCall_ (video.js:10254)
    at Player.play (video.js:10310)
    at PlayToggle.handleClick (video.js:4908)
    at HTMLButtonElement.ret (video.js:18397)
    at HTMLButtonElement.data.dispatcher (video.js:18045)

Also, i think the video on Chromecast should stop and not show the browser Chromecast extension confirmation window to open.

Another issus, if i dynamically change video it won't load on Chromecast, it will be usefull to allow loading new video to Chromecast from Videojs api the same way we load another video with javascript.
And allowing to send Title - Subtitle - and the new Poster

  player.src({
    "type": player.currentType(),
    "src": player.currentSrc()
  });
  player.load();
  player.play();

Start playing new video if cast session exist and new videojs player opened

Currently if we start casting from one video and go to the other video and click play then cast session catches previous video and continues playing it. Expected behavior that if we start playing new video then it starts casting new media to existing session.

I am suggesting to add an option to the plugin (or even hardcode it) to start casting new video when another video was opened. The new media can be loaded on cast event "sessionJoinedListener" when we are joining existing cast session.

Let me know what you think on this issue. I am willing to add this functionality and create pull request.

Update documentation

It would be very useful for the user if we update the documentation of the plugin, as well as the screenshots.

Regards.

Issue on Android System WebView

I was trying to play these videos http://www.americatv.com.ar/vivo http://www.tvpublica.com.ar/vivo/ on a browser based on the Android System WebView and noticed this error:

cast.js:7 Uncaught ReferenceError: chrome is not defined
at t.value (cast.js:7)
at new t (cast.js:7)
at ControlBar.addChild (video.js:1009)
at handleAdd (video.js:1174)
at Array.forEach ()
at video.js:1221
at ControlBar.initChildren (video.js:1222)
at ControlBar.Component (video.js:686)
at new ControlBar (video.js:2465)
at Player.addChild (video.js:1009)

I saw that cast.js seems to be made by Benjipott, Inc. so I figured I would report the error here.

Android webview

Hi .. Can someone help getting this to work in Android webview ?

It works fine in Chrome browser

All help welcome :-)

Error after casting

I'm getting this after clicking the cast button:

videojs.chromecast.js:440 Uncaught TypeError: _videoJs2.default.createEl is not a function

It goes ahead and casts anyway. But I think some functionality may be missing.

Here's the full trace (no idea how to get this formatted from Chrome):

videojs.chromecast.js?1470544571000000000:440 Uncaught TypeError: videoJs2.default.createEl is not a functioncreateEl @ videojs.chromecast.js?1470544571000000000:440a @ video.min.js:12b @ video.min.js:20Chromecast @ videojs.chromecast.js?1470544571000000000:380b.loadTech @ video.min.js:17onMediaDiscovered @ videojs.chromecast.js?1470544571000000000:245sessionJoinedListener @ videojs.chromecast.js?1470544571000000000:128e.ad @ cast_sender.js:84e.onMessage @ cast_sender.js:84T.$c @ cast_sender.js:55

Using Google Cast native controls are not reflected in VideoJS Player

Clicking stop casting, the mute button and the pause button are not reflected in the videojs player. You can stop casting and the player will still say it's casting. Pausing from the Google Cast control will also not switch the videojs player pause button to a play button either nor mute to unmute and vice versa.

Issues with VideoJS 6.6.3

I'm building a react app where I'm trying to use video.js-chromecast but I think I'm missing something very obvious. I am blaming it on the lack of sleep but I would be very grateful if somebody with half brain could take a look at it since I can't even make it work with plain ol' javascript.

I made a pen to play around with here: https://codepen.io/animazing/pen/mxzbNr

What am I doing wrong, shouldn't a chromecast button appear?

Subtitle menu disappears when casting

VideoJS v6.6.2
VideoJs Chromecast v2.09

Subtitle menu disappears when trying to cast, when I stop casting it doesn't come back.
The vjs-hidden is toggled on the subtitle menu, but also the subtitle items seems to be removed.
Why is this happening and how to fix it?

Test on VideoJS version 4,5 & 6

https://i.imgur.com/2YSeVMc.gif

Error on ending cast

Hello,

When ending cast we have an error no media found.

We are casting using HLS stream.

player erro player.error()r
MediaError {code: 4, message: "No compatible source was found for this media."}
code
:
4
message
:
"No compatible source was found for this media."
proto
:
Object

Regards,

how to use subtitles with chromecast

I can add the subtitle lang text but not the subtitles itself

the subtitle text is shown below the title when starting chromecast but how can I add the actual .srt file

<video poster="" width="100%" height="100%" class="video-js vjs-default-skin" data-setup='{ "plugins" : { "resolutionSelector" : { "default_res" : "720" }, "chromecast" : { "metadata" : { "title" : "", "subtitle" : "" } } } }' controls autoplay>

Chomecast button position a little off

Hi,
i find that the Chomecast button position is a little off.
margin-top: 1px;

add this to CSS.

.video-js .vjs-chromecast-button {
    margin-top: 1px; /*add margin top*/
    font-size: 0.7em;
}

Cannot bundle video.js-chromecast using browserify

Description

We need to be able to bundle the videojs-chromecast plugin into our browserified js bundle.

After running npm install --save videojs-chromecast, adding a require('videojs-chromecast') statement to our project's source and running browserify to create a bundle, the browserify command fails with the following error:

Error: Cannot find module 'browserify-shim' from '/sample-project/node_modules/videojs-chromecast'
    at /sample-project/node_modules/resolve/lib/async.js:48:31
    at processDirs (/sample-project/node_modules/resolve/lib/async.js:182:39)
    at ondir (/sample-project/node_modules/resolve/lib/async.js:197:13)
    at load (/sample-project/node_modules/resolve/lib/async.js:80:43)
    at onex (/sample-project/node_modules/resolve/lib/async.js:105:17)
    at /sample-project/node_modules/resolve/lib/async.js:26:73
    at FSReqWrap.oncomplete (fs.js:82:15)

Version information

  • npm - 4.5.0
  • browserify - 14.4.0
  • video.js-chromecast - 2.0.8

Steps to reproduce

  1. Create a folder called sample-project.
  2. Add this package.json file to sample-project:
{
  "name": "sample-project",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "build": "mkdir -p dist; browserify index.js -o dist/index.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "videojs-chromecast": "2.0.8"
  },
  "devDependencies": {
    "browserify": "14.4.0"
  }
}
  1. Add this index.js file to sample-project:
'use strict';

require('videojs-chromecast');
  1. Run npm install
  2. Run npm run build
  3. Observe the error described above.

Add compatibility with videojs 4.6

Updating to version 4.6 causes an issue when you try to resume playback locally in Chrome. The issue is in
vjs.ChromeCastComponent.prototype.onStopAppSuccess. I think the issue is this gets run:
this.player_.src(this.player_.options_['sources']);
and in 4.6 the player now resets when you change the source
videojs/video.js#1124

The below code solves this but is not the correct way to do it. The key here is running load() to get it to reload the file locally.

// Fix for 4.6 not working correctly otherwise
this.player_.load();

var context = this;
setTimeout(function(){
if (context.apiMedia.playerState == "IDLE") {
    context.player_.currentTime(0);
    context.player_.onPause();
} else {

    if (!this.paused) {
        context.player_.play();
    }
    context.player_.currentTime(context.currentMediaTime);
}
this.apiMedia = null;
},500);

Video.js 6.x compatibility

Hi, I think this plugin is awesome, and it would be great to make it compatible with Video.js 6.x versions.

When loading the plugin with Video.js 6.2.0 I get this error:

video.min.js:2 Uncaught Error: Illegal component, "Chromecast"; techs must be registered using Tech.registerTech(). at Function.t.registerComponent (video.min.js:2) at Object.<anonymous> (videojs-chromecast.js:881) at Object.2 (videojs-chromecast.js:885) at s (videojs-chromecast.js:7) at videojs-chromecast.js:7 at Object.<anonymous> (videojs-chromecast.js:916) at Object.3../component/control-bar/chromecast-button (videojs-chromecast.js:967) at s (videojs-chromecast.js:7) at videojs-chromecast.js:7 at Object.<anonymous> (videojs-chromecast.js:982)

Is it possible to make it compatible with 6.x version? Thanks very much.

Does not work in Chrome iOS

if (!videojs.browser.IS_CHROME || videojs.browser.IS_EDGE || typeof chrome === 'undefined') {

videojs.browser.IS_CHROME does not return true when using Chrome on iOS.

Checking for videojs.browser.IS_EDGE is redundant as well, since videojs already checks for that as part of IS_CHROME:

https://github.com/videojs/video.js/blob/bc2da7c67bfe1be6deb811269ed3b4a438f8c1a6/src/js/utils/browser.js#L62

To make it work on iOS, I had to do something like:

-        if (!videojs.browser.IS_CHROME || videojs.browser.IS_EDGE || typeof chrome === 'undefined') {
+        let user_agent = window.navigator && window.navigator.userAgent || ''
+        let is_chrome = videojs.browser.IS_CHROME || (/CriOS/i).test(user_agent)
+        if (!is_chrome || videojs.browser.IS_EDGE || typeof chrome === 'undefined') {```

Chrome Cast button disappears when I make the video full-screen

Not sure if this was done purposefully, but the chromecast button works just fine, until I make the video full-screen at which point it simply disappears. Is this a bug or purposefully done?

It seems that as I make the video full-screen, there is a slight fade out of the chromecast button so perhaps it is done purposefully. If so, is there a reason for that or any way around it?

Here is roughly the code I am currently using:

let opts = {
      // Other options
      },
      plugins: {
        skip: {},
        cc: {}
        },
        chromecast: {
          enabled: true,
          appId: chromecastAppId,
          title: chromecastTitle,
          subTitle: chromecastSubTitle,
          description: chromecastDescription,
          src: this.src(),
          mimeType: this.mimeType(),
          imageSrc: chromecastThumbnail,
          autoplay: this.autoplay(),
          offset: offset,
          resumeOnClose: !(settings.chromecast.forceSmallWindowForLive),
          durationFn: () => {
            if (settings.chromecast.forceSmallWindowForLive) {
              return 0
            } else {
              return this.player.duration()
            }
          }
        }
      }
    }

this.player = videojs('video-player', opts, function () {
  // do stuff
})

Thanks!

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.