Improve api interactions and add Key binding to VideoPlayer #191

This commit is contained in:
Prayag Prajapati committed 2023-10-02 17:45:04 +05:30
1 parent 674bde06df
commit b0fc4f7f51
6 files changed
+216 -42

No files matched your search

+17
View File
@@ -10,11 +10,28 @@ export const usePlaybackStore = create((set) => ({
itemName: "",
subtitleTracks: [],
selectedSubtitleTrack: 0,
mediaSourceId: "",
audioStreamIndex: 0,
videoStreamIndex: 0,
subtitleStreamIndex: 0,
userId: "",
mediaContainer: "",
setUrl: (aurl) => set((state) => ({ ...state, url: aurl })),
setPosition: (apos) => set((state) => ({ ...state, startPosition: apos })),
setDuration: (adur) => set((state) => ({ ...state, duration: adur })),
setItemId: (aid) => set((state) => ({ ...state, itemId: aid })),
setItemName: (anm) => set((state) => ({ ...state, itemName: anm })),
setUserId: (anm) => set((state) => ({ ...state, userId: anm })),
setMediaContainer: (anm) =>
set((state) => ({ ...state, mediaContainer: anm })),
setMediaSourceId: (anm) =>
set((state) => ({ ...state, mediaSourceId: anm })),
setAudioStreamIndex: (anm) =>
set((state) => ({ ...state, audioStreamIndex: anm })),
setVideoStreamIndex: (anm) =>
set((state) => ({ ...state, videoStreamIndex: anm })),
setSubtitleStreamIndex: (anm) =>
set((state) => ({ ...state, subtitleStreamIndex: anm })),
setSubtitleTracks: (asub) =>
set((state) => ({
...state,