Compare commits

..

No commits in common. "d27ec4d63415f1ecf61c0090daad3cc17239474d" and "91a367321979a8cca46e5f4f820f23b55c257bc0" have entirely different histories.

1 changed files with 3 additions and 14 deletions

View File

@ -25,7 +25,6 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
const [videoSrc, setVideoSrc] = useState<string>('')
const [fileExists, setFileExists] = useState<boolean>(true)
const [errorMessage, setErrorMessage] = useState<string>('')
const [loadingMethod, setLoadingMethod] = useState<'convertFileSrc' | 'dataUrl'>('convertFileSrc')
useEffect(() => {
const checkFileAndSetSrc = async () => {
@ -269,16 +268,7 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
<AlertCircle size={64} className="mx-auto mb-4 text-red-400" />
<h3 className="text-xl font-medium mb-2"></h3>
<p className="text-gray-300 mb-4">{errorMessage}</p>
<p className="text-sm text-gray-400 mb-4">: {videoPath}</p>
<p className="text-xs text-gray-500 mb-4">: {loadingMethod}</p>
{loadingMethod === 'convertFileSrc' && (
<button
onClick={tryDataUrlMethod}
className="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors"
>
</button>
)}
<p className="text-sm text-gray-400">: {videoPath}</p>
</div>
</div>
) : (
@ -287,15 +277,14 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
src={videoSrc}
className="w-full h-auto max-h-[70vh]"
onClick={handlePlayPause}
onError={async (e) => {
onError={(e) => {
console.error('Video loading error:', {
error: e,
videoSrc,
originalPath: videoPath,
currentTarget: e.currentTarget,
networkState: e.currentTarget.networkState,
readyState: e.currentTarget.readyState,
currentMethod: loadingMethod
readyState: e.currentTarget.readyState
})
// 如果当前视频源失败,尝试重新加载
if (videoPath) {