Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Domand動画サーバーのみの時の画質選択不能バグ #37

Closed
kphrx opened this issue Feb 21, 2024 · 3 comments
Closed

Domand動画サーバーのみの時の画質選択不能バグ #37

kphrx opened this issue Feb 21, 2024 · 3 comments
Labels

Comments

@kphrx
Copy link
Owner

kphrx commented Feb 21, 2024

dmc.nico動画サーバーにアップロードされなくなった最近の動画で画質選択ができなくて現在の画質も分からなくなるバグが見つかった

isDomandOnly 周りの処理が悪い?

このあたりとCSS

async _onVideoInfoLoaderLoad(requestId, [videoInfoData, localCacheData]) {
console.log('VideoInfoLoader.load!', requestId, this._watchId, videoInfoData);
if (this._requestId !== requestId) {
return;
}
const videoInfo = this._videoInfo = new VideoInfoModel(videoInfoData, localCacheData);
this._watchId = videoInfo.watchId;
WatchInfoCacheDb.put(this._watchId, {videoInfo});
let serverType;
let videoQuality;
if (!videoInfo.isDomandOnly && this._playerConfig.props.autoDisableNew && videoInfo.maybeBetterQualityServerType === 'dmc') {
serverType = 'dmc';
videoQuality = this._playerConfig.props.dmcVideoQuality;
} else if (videoInfo.isDomandOnly || (this._videoWatchOptions.videoServerType === 'domand' && videoInfo.isDomandAvailable)) {
serverType = 'domand';
videoQuality = this._playerConfig.props.domandVideoQuality;
} else if (videoInfo.isDmcOnly || (this._videoWatchOptions.videoServerType === 'dmc' && videoInfo.isDmcAvailable)) {
serverType = 'dmc';
videoQuality = this._playerConfig.props.dmcVideoQuality;
} else {
serverType = 'domand';
videoQuality = this._playerConfig.props.domandVideoQuality;
}
this._state.setState({
isDomandAvailable: videoInfo.isDomandAvailable,
isDmcAvailable: videoInfo.isDmcAvailable,
isCommunity: videoInfo.isCommunityVideo,
isMymemory: videoInfo.isMymemory,
isChannel: videoInfo.isChannel,
isLiked: videoInfo.isLiked
});
MediaSessionApi.updateByVideoInfo(this._videoInfo);
const isHLSRequired = videoInfo.isHLSRequired;
const isHLSSupported = !!global.debug.isHLSSupported ||
document.createElement('video').canPlayType('application/vnd.apple.mpegURL') !== '' ||
document.createElement('video').canPlayType('application/x-mpegURL') !== '';
const useHLS = isHLSSupported && (isHLSRequired || !this._playerConfig.props['video.hls.enableOnlyRequired'] || serverType != 'dmc');
this._videoSession = await VideoSessionWorker.create({
videoInfo,
videoQuality,
serverType,
useHLS
});
if (this._videoFilter.isNgVideo(videoInfo)) {
return this._onVideoFilterMatch();
}
try {
if (this._videoSession.isDmc) {
await NVWatchCaller.call(videoInfo.dmcInfo.trackingId)
}
const sessionInfo = await this._videoSession.connect();
this.setVideo(sessionInfo.url);
videoInfo.setCurrentVideo(sessionInfo.url);
this.emit('videoServerType', sessionInfo.type, sessionInfo, videoInfo);
} catch (e) {
this._onVideoSessionFail(this._videoSession.serverType, e);
}
this._state.videoInfo = videoInfo;
this.loadComment(videoInfo.msgInfo);
this.emit('loadVideoInfo', videoInfo);
this.emitResolve('firstVideoInitialized', this._watchId);
if (Fullscreen.now() || this._playerConfig.props.screenMode === 'wide') {
this.execCommand('notifyHtml',
`<img src="${textUtil.escapeHtml(videoInfo.thumbnail)}" style="width: 96px;">` +
util.escapeToZenkaku(videoInfo.title)
);
}
}

@kphrx kphrx added the bug label Feb 21, 2024
@kphrx
Copy link
Owner Author

kphrx commented Feb 21, 2024

/* dmcを使用不能の時はdmc選択とdmc画質選択を薄く */
.zenzaPlayerContainer:not(.is-dmcAvailable) .serverType.select-server-dmc,
.zenzaPlayerContainer:not(.is-dmcAvailable) .currentVideoQuality {
opacity: 0.4;
pointer-events: none;
text-shadow: none !important;
}
.zenzaPlayerContainer:not(.is-dmcAvailable) .currentVideoQuality {
display: none;
}
.zenzaPlayerContainer:not(.is-dmcAvailable) .serverType.select-server-dmc span:before {
display: none !important;
}
.zenzaPlayerContainer:not(.is-dmcAvailable) .serverType {
pointer-events: none;
}

selectorの条件がちゃんと絞られてなくて .serverType を共に pointer-events: none; にしていたのが悪かった

@kphrx
Copy link
Owner Author

kphrx commented Feb 22, 2024

071fee1 で修正

@kphrx
Copy link
Owner Author

kphrx commented Feb 22, 2024

ついでにdmc.nicoの中画質は5年前に480pで統一されてて watch data でもこの値でラベルがついてるので内部の区分けも変えたい
https://blog.nicovideo.jp/niconews/99566.html

27fc665 画質の選択に正規表現ではなくラベルを利用するように変更

@kphrx kphrx closed this as completed in 071fee1 Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant