-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
youtube-player startSeconds and endSeconds not working #18212
Labels
P2
The issue is important to a large percentage of users, with a workaround
Comments
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Jan 19, 2020
The way the `youtube-player` is set up is that the start and end seconds are observables which means that the consumer will miss out on any values that were emitted before they subscribed. These changes switch them to a `BehaviorSubject` which emits its last value upon subscription. Also does some internal cleanup in the component. Fixes angular#18212.
jelbourn
pushed a commit
that referenced
this issue
Jan 22, 2020
#18214) The way the `youtube-player` is set up is that the start and end seconds are observables which means that the consumer will miss out on any values that were emitted before they subscribed. These changes switch them to a `BehaviorSubject` which emits its last value upon subscription. Also does some internal cleanup in the component. Fixes #18212.
jelbourn
pushed a commit
that referenced
this issue
Jan 22, 2020
#18214) The way the `youtube-player` is set up is that the start and end seconds are observables which means that the consumer will miss out on any values that were emitted before they subscribed. These changes switch them to a `BehaviorSubject` which emits its last value upon subscription. Also does some internal cleanup in the component. Fixes #18212. (cherry picked from commit 8f2007f)
yifange
pushed a commit
to yifange/components
that referenced
this issue
Jan 30, 2020
angular#18214) The way the `youtube-player` is set up is that the start and end seconds are observables which means that the consumer will miss out on any values that were emitted before they subscribed. These changes switch them to a `BehaviorSubject` which emits its last value upon subscription. Also does some internal cleanup in the component. Fixes angular#18212.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Reproduction
Steps to reproduce:
startSeconds
andendSeconds
Expected Behavior
What behavior were you expecting to see?
I expected to see the video start playing at the 40 second mark.
Actual Behavior
This method
fired before this line in YouTubePlayer.ngOnInit
The same is true for
endSeconds
andsuggestedQuality
.The effect is that the initial
startSeconds
andendSeconds
value specified by the wrapper component is reset toundefined
For example: if the template was
The property
startSeconds
will triggerthis._startSeconds.emit(40);
, thenstartSecondObs
will be set tostartWith(undefined)
, and from there on, the initial values40
and60
no longer honored.Work around: in the component that uses , use template variables to keep track of startSeconds, endSeconds, and suggestedQuality, and leverage setTimeout or lodash.defer to set those values a 2nd time.
Glancing at the code, I believe the correct approach has been handled for videoId, width, and height. It just has not been propagated to startSeconds, endSeconds, and suggestedQuality.
Environment
The text was updated successfully, but these errors were encountered: