Bug 1550633 - part3 : add debug log to show track's kind. r=jya

Showing track's kind in debug log is helpful.

Differential Revision: https://phabricator.services.mozilla.com/D31373

--HG--
extra : moz-landing-system : lando
This commit is contained in:
alwu 2019-05-20 09:30:19 +00:00
Родитель fa25e850f3
Коммит 37cc9f6d00
1 изменённых файлов: 20 добавлений и 1 удалений

Просмотреть файл

@ -54,6 +54,24 @@ static const char* ToReadyStateStr(const TextTrackReadyState aState) {
return "Unknown";
}
static const char* ToTextTrackKindStr(const TextTrackKind aKind) {
switch (aKind) {
case TextTrackKind::Subtitles:
return "Subtitles";
case TextTrackKind::Captions:
return "Captions";
case TextTrackKind::Descriptions:
return "Descriptions";
case TextTrackKind::Chapters:
return "Chapters";
case TextTrackKind::Metadata:
return "Metadata";
default:
MOZ_ASSERT_UNREACHABLE("Invalid kind.");
}
return "Unknown";
}
NS_IMPL_CYCLE_COLLECTION_INHERITED(TextTrack, DOMEventTargetHelper, mCueList,
mActiveCueList, mTextTrackList,
mTrackElement)
@ -112,7 +130,8 @@ void TextTrack::SetMode(TextTrackMode aValue) {
if (mMode == aValue) {
return;
}
WEBVTT_LOG("Set mode=%s", ToStateStr(aValue));
WEBVTT_LOG("Set mode=%s for track kind %s", ToStateStr(aValue),
ToTextTrackKindStr(mKind));
mMode = aValue;
HTMLMediaElement* mediaElement = GetMediaElement();