MCPcopy
hub / github.com/tjallingt/react-youtube / shouldResetPlayer

Function shouldResetPlayer

packages/react-youtube/src/YouTube.tsx:50–54  ·  view source on GitHub ↗

* Check whether a `props` change should result in the player being reset. * The player is reset when the `props.opts` change, except if the only change * is in the `start` and `end` playerVars, because a video update can deal with * those.

(prevProps: YouTubeProps, props: YouTubeProps)

Source from the content-addressed store, hash-verified

48 * those.
49 */
50function shouldResetPlayer(prevProps: YouTubeProps, props: YouTubeProps) {
51 return (
52 prevProps.videoId !== props.videoId || !isEqual(filterResetOptions(prevProps.opts), filterResetOptions(props.opts))
53 );
54}
55
56/**
57 * Check whether a props change should result in an update of player.

Callers 1

componentDidUpdateMethod · 0.85

Calls 1

filterResetOptionsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…