After a video of a testy confrontation between a white apartment house resident and an African American visitor on the Fourth of July in San Francisco racked up millions of views on social media, the resident stepped forward to explain that one reason for the exchange is that his father had been slain in his driveway by a stranger.

“I was coming into this situation with my unique history,” Christopher Cukor wrote on the website Medium. “My father was murdered outside his home by a trespasser who he confronted alone.”

The three-minute video clip encapsulated in moments the issues of race, crime, viral social media postings and the inability of two people to find common ground without calling the police.

In the video, Cukor encounters a man identified as Wesly Michel at the front door to his apartment building at Van Ness Avenue and Washington Street. He asks him to use the call box to gain entry rather than to proceed through the open door, as Cukor and his young son are leaving.

Michel begins recording the incident on his cell phone camera as Cukor calls 911 and tells a dispatcher, “There’s a trespasser in my building.”

“You’re going to be the next person on TV,” Michel says, as the camera continues recording.

Cukor is the son of Peter Cukor, who was bludgeoned to death with a flowerpot in 2012 in front of his Berkeley home after confronting Daniel Dewitt, a 23-year-old Alameda man with a history of mental illness. Dewitt was convicted and sentenced to 33 years to life in a state mental hospital.

In the Fourth of July video, the two men argue in the presence of Cukor’s young son, who is visibly upset by the confrontation and tries to persuade his father not to call police.

“Listen to your son and walk away,” Michel says. “(And) I will stop this recording.”

Insisting his decision to call police was not racially motivated, Cukor said in his Medium post that he’d “encountered trespassers in my building and we’ve been robbed several times. This is not uncommon in San Francisco and the bad actors are all different colors.”

Cukor acknowledged that Michel was “reacting based on his unique history as well — unfortunately, there is a terrible pattern of people calling the authorities regarding people of color for no other reason than their race.”

“I’m sorry my actions caused Wesly to feel unfairly targeted due to his race,” Cukor wrote.

Attempts to reach Cukor and Michel were not immediately successful.

The Fourth of July video echoed the so-called “barbecuing while black” video of 2018, which also went viral. In that video, a white woman called police to report a black man was using the wrong kind of barbecue grill at Lake Merritt in Oakland.

Steve Rubenstein is a San Francisco Chronicle staff writer. Email: srubenstein@sfchronicle.com Twitter: SteveRubeSF