react-player icon indicating copy to clipboard operation
react-player copied to clipboard

Mixcloud throws 'postMessage' on 'DOMWindow' error and invalid VidYard url doesn't fire onReady.

Open AbrahamLara opened this issue 4 years ago • 1 comments

Current Behavior

  • Passing a valid Mixcloud url to react-player throws "Failed to execute 'postMessage' on 'DOMWindow'" error message even though the player successfully loads. I noticed this same issue occurred previously with YouTube in this ticket. I'm wondering whether or not the library can do anything about it given this comment from the author and if the same fix for YouTube can even apply here.
  • Passing an invalid VidYard url to react-player doesn't fire onReady (as well as mixcloud) like SoundCloud for example. Also wondering if the library may or may not be able to do something about it.

Expected Behavior

  • Mixcloud doesn't throw "Failed to execute 'postMessage' on 'DOMWindow'"
  • VidYard (and Mixcloud) to call onReady.

Steps to Reproduce

  1. Visit CodeSandbox link (these issues can even be reproduce in the demo site).

Environment

  • CodeSandbox example: https://codesandbox.io/s/nostalgic-montalcini-phpkg?file=/src/App.js

Other Information

Mixcloud error messages: mixcloud_errors

Vidyard error messages: vidyard_errors

AbrahamLara avatar Aug 09 '21 20:08 AbrahamLara

In case anyone would actually be looking at this...

<!DOCTYPE html>
<html>
	<head>
		<script src="https://widget.mixcloud.com/media/js/widgetApi.js" type="text/javascript"></script>
		<script type="text/javascript">
			function loadVideo() {
				const frame = document.getElementById("myframe");
				const player = Mixcloud.PlayerWidget(frame);
				player.ready.then(function() {
					console.warn('player loaded');
				});
			}
		</script>
	</head>
	<body>
		<button onclick="loadVideo()">Load video</button>
		<iframe id="myframe"></iframe>
	</body>
</html>

image

StackBlitz

PieterjanDeClippel avatar Oct 09 '23 09:10 PieterjanDeClippel