{"record":{"id":"5069945fe8a280fe","repo":"MonoGame/MonoGame","slug":"video-is-null","errorCode":null,"errorMessage":"video is null.","messagePattern":"video is null\\.","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"MonoGame.Framework/Media/VideoPlayer.cs","lineNumber":189,"sourceCode":"        /// </summary>\n        public void Pause()\n        {\n            if (_currentVideo == null)\n                return;\n\n            PlatformPause();\n\n            _state = MediaState.Paused;\n        }\n\n        /// <summary>\n        /// Plays a <see cref=\"Video\"/>.\n        /// </summary>\n        /// <param name=\"video\">Video to play.</param>\n        public void Play(Video video)\n        {\n            if (video == null)\n                throw new ArgumentNullException(\"video is null.\");\n\n            if (_currentVideo == video)\n            {\n                var state = State;\n\t\t\t\t\t\t\t\n                // No work to do if we're already\n                // playing this video.\n                if (state == MediaState.Playing)\n                    return;\n\n                // If we try to Play the same video\n                // from a paused state, just resume it instead.\n                if (state == MediaState.Paused)\n                {\n                    PlatformResume();\n                    _state = MediaState.Playing;\n                    return;\n                }","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/MonoGame/MonoGame/blob/1d71bbd0ff4071a03caa583aa3bc56b85924a819/MonoGame.Framework/Media/VideoPlayer.cs#L171-L207","documentation":"Thrown by VideoPlayer.Play(Video) when the video argument is null. The player needs a Video to initialize the platform playback pipeline, so a null reference is rejected immediately with ArgumentNullException.","triggerScenarios":"Calling videoPlayer.Play(null), or passing a Video that is null because Content.Load<Video> returned null (missing or misnamed asset) or the field was never assigned.","commonSituations":"Content asset name typo for the video, the video not included in the content build, or referencing a video field before it is loaded.","solutions":["Verify the content path matches the asset name and the video is in the content pipeline.","Null-check the loaded Video before calling Play.","Ensure the Video field is assigned from a successful load."],"exampleFix":"// before\nvar vid = Content.Load<Video>(\"intro_bad\");\nvideoPlayer.Play(vid);\n// after\nvar vid = Content.Load<Video>(\"intro\");\nif (vid != null) videoPlayer.Play(vid);","handlingStrategy":"validation","validationCode":"if (video == null) return;\nvideoPlayer.Play(video);","typeGuard":"static bool IsVideoPlayable(Video v) => v != null;","tryCatchPattern":null,"preventionTips":["Null-check the result of Content.Load<Video>.","Verify the video asset is included in the content build."],"tags":["media","video","videoplayer","null-argument","content"],"backgroundTag":null,"analyzedSha":"1d71bbd0ff4071a03caa583aa3bc56b85924a819","analyzedAt":"2026-08-13T17:10:33.625Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}