Skip to content

Commit de9afed

Browse files
committed
Merge master into alpha
2 parents 0b2ab74 + a1fadae commit de9afed

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

src/bloom-player-core.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,9 +2561,27 @@ export class BloomPlayerCore extends React.Component<IProps, IPlayerState> {
25612561
setCurrentNarrationPage(bloomPage);
25622562
// State must be set before calling HandlePageVisible() and related methods.
25632563
if (BloomPlayerCore.currentPageHasVideo) {
2564+
const handleVideoAndMusic = () => {
2565+
this.video.HandlePageVisible(
2566+
bloomPage,
2567+
() => this.props.paused,
2568+
);
2569+
this.music.pause(); // in case we have audio from previous page
2570+
};
25642571
setCurrentPlaybackMode(PlaybackMode.VideoPlaying);
2565-
this.video.HandlePageVisible(bloomPage, () => this.props.paused);
2566-
this.music.pause(); // in case we have audio from previous page
2572+
if (!this.sentBloomNotification) {
2573+
this.sentBloomNotification = true; // actually we may not, but if we don't, we never want to
2574+
if (this.props.shouldReportSoundLog) {
2575+
// This notification allows Bloom to start recording video at the optimum moment,
2576+
// when the first page is rendered enough for us to start playing its video.
2577+
sendStringToBloomApi(
2578+
"/publish/av/startRecording",
2579+
this.videoList,
2580+
).then(handleVideoAndMusic);
2581+
return; // don't call handleVideoAndMusic until the post returns
2582+
}
2583+
}
2584+
handleVideoAndMusic(); // if we decided not to post to bloom api
25672585
} else {
25682586
this.playAudioAndAnimation(bloomPage);
25692587
}

src/shared/dragActivityRuntime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export function prepareActivity(
172172
// don't want to show controls on these, because they are typically too small,
173173
// and the play time is short enough that just click-to-play is fine
174174
video.classList.add("bloom-ui-no-controls");
175-
// non-draggable video click detectors are handled separately, seee handleVideoClick in video.ts,
175+
// non-draggable video click detectors are handled separately, see handleVideoClick in video.ts,
176176
// and in BloomDesktop handleVideoClick in bloomVideo.ts.
177177
video.addEventListener("pointerdown", playVideo);
178178
}

0 commit comments

Comments
 (0)