从reactJS中的IndexedDB获取视频URL

从reactJS中的IndexedDB获取视频URL,reactjs,redux,react-hooks,redux-saga,indexeddb,Reactjs,Redux,React Hooks,Redux Saga,Indexeddb,我从服务器上得到一个blob,并将其转换为存储和indexedDB中的url(以防止下次向服务器发送请求) 要加载视频,我从存储读取数据 当存储区第一次从服务器获取数据时(在收到响应后,将其设置),视频加载不会出现任何问题 但是在刷新之后,当从indexedDB设置存储时,视频将不会加载 错误为:doException:元素没有受支持的源。 但url与第一次加载视频的url相同 在收到响应后设置IDB和store:in Sagas.js const Url = window.URL.crea

我从服务器上得到一个blob,并将其转换为存储和indexedDB中的url(以防止下次向服务器发送请求) 要加载视频,我从存储读取数据 当存储区第一次从服务器获取数据时(在收到响应后,将其设置),视频加载不会出现任何问题 但是在刷新之后,当从indexedDB设置存储时,视频将不会加载

错误为:doException:元素没有受支持的源。

但url与第一次加载视频的url相同

在收到响应后设置IDB和store:in Sagas.js

  const Url = window.URL.createObjectURL(new Blob([response.data]));
        yield localforage.setItem(`${action.contentData.id}`, { ...action.contentData, url: Url })
        yield put(SetCurrentContent({ ...action.contentData, url: Url }))
useffect:Video.jsx的paretnt

let currentContentIDB;
  useEffect(async () => {
    try {
      //fetch current contentdata from IDB
      currentContentIDB = await localforage.getItem(match.params.id);
    } catch (err) {
      console.log(err, "err localforage");
    }
    if (!currentContentIDB) {
      await props.onfetchCurrentContent(match.params.id);
    } else {
      if (
        !(
          props.currentContentStore.url &&
          props.currentContentStore.id === parseInt(match.params.id)
        )
      ) {
        //If the saved data in the store is not the data we need on this page, set store from IDB
        props.onSetCurrentContent(currentContentIDB);
      }
    }

  }, []);
 <video
      id="video"
      src={props.CurrentContentURL}
      controlsList="nodownload"
    ></video>
和video.jsx中的视频标记

let currentContentIDB;
  useEffect(async () => {
    try {
      //fetch current contentdata from IDB
      currentContentIDB = await localforage.getItem(match.params.id);
    } catch (err) {
      console.log(err, "err localforage");
    }
    if (!currentContentIDB) {
      await props.onfetchCurrentContent(match.params.id);
    } else {
      if (
        !(
          props.currentContentStore.url &&
          props.currentContentStore.id === parseInt(match.params.id)
        )
      ) {
        //If the saved data in the store is not the data we need on this page, set store from IDB
        props.onSetCurrentContent(currentContentIDB);
      }
    }

  }, []);
 <video
      id="video"
      src={props.CurrentContentURL}
      controlsList="nodownload"
    ></video>