mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fixed video stop issue
This commit is contained in:
parent
031afb1b8e
commit
78e7572d76
2 changed files with 17 additions and 6 deletions
|
@ -483,7 +483,7 @@ _V_.ResolutionMenuItem = _V_.MenuItem.extend({
|
||||||
jQuery( this.player.controlBar.el ).find( '.vjs-quality-text' ).html( this.options.label );
|
jQuery( this.player.controlBar.el ).find( '.vjs-quality-text' ).html( this.options.label );
|
||||||
|
|
||||||
// Change the source and make sure we don't start the video over
|
// Change the source and make sure we don't start the video over
|
||||||
var currentSrc = $("#"+this.options.src[0].vid_id).find('video').attr("src");
|
var currentSrc = this.player.tag.src;
|
||||||
var newSrc = currentSrc.replace("videoBitrate="+resolutions[this.player.options.currentResolution],"videoBitrate="+resolutions[this.options.src[0].res]);
|
var newSrc = currentSrc.replace("videoBitrate="+resolutions[this.player.options.currentResolution],"videoBitrate="+resolutions[this.options.src[0].res]);
|
||||||
|
|
||||||
if (this.player.duration() == "Infinity") {
|
if (this.player.duration() == "Infinity") {
|
||||||
|
@ -657,7 +657,7 @@ _V_.ChapterMenuItem = _V_.MenuItem.extend({
|
||||||
//jQuery( this.player.controlBar.el ).find( '.vjs-chapter-text' ).html( this.options.label );
|
//jQuery( this.player.controlBar.el ).find( '.vjs-chapter-text' ).html( this.options.label );
|
||||||
|
|
||||||
if (this.player.duration() == "Infinity") {
|
if (this.player.duration() == "Infinity") {
|
||||||
var currentSrc = $("#"+this.options.src[0].vid_id).find('video').attr("src");
|
var currentSrc = this.player.tag.src;
|
||||||
|
|
||||||
if (currentSrc.indexOf("StartTimeTicks") >= 0) {
|
if (currentSrc.indexOf("StartTimeTicks") >= 0) {
|
||||||
var newSrc = currentSrc.replace(new RegExp("StartTimeTicks=[0-9]+","g"),"StartTimeTicks="+this.options.src[0].StartPositionTicks);
|
var newSrc = currentSrc.replace(new RegExp("StartTimeTicks=[0-9]+","g"),"StartTimeTicks="+this.options.src[0].StartPositionTicks);
|
||||||
|
|
|
@ -186,8 +186,21 @@
|
||||||
|
|
||||||
var elem = MediaPlayer.mediaElement;
|
var elem = MediaPlayer.mediaElement;
|
||||||
|
|
||||||
elem.pause();
|
//check if it's a video using VideoJS
|
||||||
elem.src = "";
|
if ($(elem).hasClass("vjs-tech")) {
|
||||||
|
var player = _V_("videoWindow");
|
||||||
|
|
||||||
|
if (player.techName == "html5") {
|
||||||
|
player.tag.src = "";
|
||||||
|
player.tech.removeTriggers();
|
||||||
|
player.load();
|
||||||
|
}
|
||||||
|
// player.tech.destroy();
|
||||||
|
player.destroy();
|
||||||
|
}else {
|
||||||
|
elem.pause();
|
||||||
|
elem.src = "";
|
||||||
|
}
|
||||||
|
|
||||||
$(elem).remove();
|
$(elem).remove();
|
||||||
|
|
||||||
|
@ -229,7 +242,6 @@ var videoJSextension = {
|
||||||
|
|
||||||
vjs_source = {};
|
vjs_source = {};
|
||||||
vjs_source.res = res;
|
vjs_source.res = res;
|
||||||
vjs_source.vid_id = vid_id;
|
|
||||||
|
|
||||||
vjs_sources[i].push( vjs_source );
|
vjs_sources[i].push( vjs_source );
|
||||||
|
|
||||||
|
@ -253,7 +265,6 @@ var videoJSextension = {
|
||||||
vjs_chapter = {};
|
vjs_chapter = {};
|
||||||
vjs_chapter.Name = chapter.Name + " (" + ticks_to_human(chapter.StartPositionTicks) + ")";
|
vjs_chapter.Name = chapter.Name + " (" + ticks_to_human(chapter.StartPositionTicks) + ")";
|
||||||
vjs_chapter.StartPositionTicks = chapter.StartPositionTicks;
|
vjs_chapter.StartPositionTicks = chapter.StartPositionTicks;
|
||||||
vjs_chapter.vid_id = vid_id;
|
|
||||||
|
|
||||||
vjs_chapters[i].push( vjs_chapter );
|
vjs_chapters[i].push( vjs_chapter );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue