diff --git a/src/players/Facebook.js b/src/players/Facebook.js index aa961da..d57e285 100644 --- a/src/players/Facebook.js +++ b/src/players/Facebook.js @@ -40,6 +40,10 @@ export class Facebook extends Component { this.callPlayer('unmute') } this.props.onReady() + + // For some reason Facebook have added `visibility: hidden` + // to the iframe when autoplay fails, so here we set it back + document.getElementById(this.playerID).querySelector('iframe').style.visibility = 'visible' } }) }) diff --git a/test/players/Facebook.js b/test/players/Facebook.js index a98c687..7d1231f 100644 --- a/test/players/Facebook.js +++ b/test/players/Facebook.js @@ -7,6 +7,14 @@ import testPlayerMethods from '../helpers/testPlayerMethods' import * as utils from '../../src/utils' import { Facebook } from '../../src/players/Facebook' +global.document = { + getElementById: () => ({ + querySelector: () => ({ + style: {} + }) + }) +} + configure({ adapter: new Adapter() }) const TEST_URL = 'https://www.facebook.com/facebook/videos/10153231379946729'