From c0ed3656255c58a26998b69b6ba6b3bb2956df46 Mon Sep 17 00:00:00 2001 From: webmiraclepro Date: Wed, 9 Sep 2015 01:39:58 +0800 Subject: [PATCH] Guard against no iframe contentWindow in Vimeo player Partially fixes https://github.com/CookPete/react-player/pull/2 --- src/players/Vimeo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/players/Vimeo.js b/src/players/Vimeo.js index 6afaedb..4c8dd9c 100644 --- a/src/players/Vimeo.js +++ b/src/players/Vimeo.js @@ -68,7 +68,7 @@ export default class Vimeo extends Base { postMessage = (method, value) => { if (!this.origin) return let data = JSON.stringify({ method, value }) - return this.iframe.contentWindow.postMessage(data, this.origin) + return this.iframe.contentWindow && this.iframe.contentWindow.postMessage(data, this.origin) } render () { let style = {