File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { defineComponent } from 'vue'
2
+ import { isNavigationFailure , NavigationFailureType } from 'vue-router'
2
3
import { mapActions , mapMutations } from 'vuex'
3
4
import shaka from 'shaka-player'
4
5
import { Utils , YTNodes } from 'youtubei.js'
@@ -1909,10 +1910,27 @@ export default defineComponent({
1909
1910
this . startNextVideoInPip = uiState . startNextVideoInPip
1910
1911
} ,
1911
1912
1912
- onPlayerReloadRequested ( ) {
1913
+ async onPlayerReloadRequested ( ) {
1913
1914
showToast ( 'Reloading player according to SABR request' )
1914
1915
this . sabrReloadCount ++
1915
- this . reloadView ( )
1916
+
1917
+ const timestamp = this . getTimestamp ( )
1918
+ if ( timestamp > 0 ) {
1919
+ // Reload at the middle should restart at current timestamp
1920
+ try {
1921
+ await this . $router . replace ( {
1922
+ path : this . $route . path ,
1923
+ query : { ...this . $route . query , timestamp : timestamp } ,
1924
+ } )
1925
+ } catch ( failure ) {
1926
+ if ( isNavigationFailure ( failure , NavigationFailureType . duplicated ) ) {
1927
+ return
1928
+ }
1929
+
1930
+ throw failure
1931
+ }
1932
+ }
1933
+ await this . reloadView ( )
1916
1934
} ,
1917
1935
1918
1936
...mapActions ( [
You can’t perform that action at this time.
0 commit comments