Skip to content

feat: added support to play youtube video from specified time #15754

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

manzil-infinity180
Copy link
Contributor

@manzil-infinity180 manzil-infinity180 commented Mar 11, 2025

Fixes #15753

Expected Behaviour

Screen.Recording.2025-03-11.at.11.29.09.AM.mp4

@jitsi-jenkins
Copy link

Hi, thanks for your contribution!
If you haven't already done so, could you please make sure you sign our CLA (https://jitsi.org/icla for individuals and https://jitsi.org/ccla for corporations)? We would unfortunately be unable to merge your patch unless we have that piece :(.

@manzil-infinity180
Copy link
Contributor Author

manzil-infinity180 commented Mar 11, 2025

playerVars: {
            'origin': location.origin,
            'fs': '0',
            'autoplay': 0,
            'controls': showControls,
            'rel': 0,
            'start': startTime || 0 // Now correctly set
        }

how can I set the value for startTime I found middleware but videoUrl is youtube id ?

If we set startTime to 255 then it will start the video from 255 sec

Signed-off-by: Rahul Vishwakarma <[email protected]>
@manzil-infinity180
Copy link
Contributor Author

@damencho @saghul any comments on it ?

@manzil-infinity180 manzil-infinity180 marked this pull request as ready for review March 12, 2025 17:02
@manzil-infinity180
Copy link
Contributor Author

manzil-infinity180 commented Mar 12, 2025

I have tested this on web, its working perfectly how I expected to be, I am not sure why the linting is throwing error

Argument of type 'typeof YoutubeVideoManager' is not assignable to parameter of type 'JSXElementConstructor<Matching<{ _conference: IJitsiConference | undefined; _isOwner: boolean; _ownerId: string | undefined; _status: string | undefined; startTime: number | undefined; _time: number; _videoUrl: string | undefined; } & DispatchProp<...>, ClassAttributes<...> & IProps>>'.

is I need to pass the startTime as _startTime when I am doing the mapStateToProps?

@manzil-infinity180
Copy link
Contributor Author

@damencho could you please review it ?

@damencho
Copy link
Member

I have tested this on web, its working perfectly how I expected to be, I am not sure why the linting is throwing error

Argument of type 'typeof YoutubeVideoManager' is not assignable to parameter of type 'JSXElementConstructor<Matching<{ _conference: IJitsiConference | undefined; _isOwner: boolean; _ownerId: string | undefined; _status: string | undefined; startTime: number | undefined; _time: number; _videoUrl: string | undefined; } & DispatchProp<...>, ClassAttributes<...> & IProps>>'.

is I need to pass the startTime as _startTime when I am doing the mapStateToProps?

The native AbstractVideoManager is requiring starttime as a number and you are passing number | undefined, types do not match.

@manzil-infinity180
Copy link
Contributor Author

I have tested this on web, its working perfectly how I expected to be, I am not sure why the linting is throwing error
Argument of type 'typeof YoutubeVideoManager' is not assignable to parameter of type 'JSXElementConstructor<Matching<{ _conference: IJitsiConference | undefined; _isOwner: boolean; _ownerId: string | undefined; _status: string | undefined; startTime: number | undefined; _time: number; _videoUrl: string | undefined; } & DispatchProp<...>, ClassAttributes<...> & IProps>>'.
is I need to pass the startTime as _startTime when I am doing the mapStateToProps?

The native AbstractVideoManager is requiring starttime as a number and you are passing number | undefined, types do not match.

fixed e2ead5a

@manzil-infinity180
Copy link
Contributor Author

manzil-infinity180 commented Mar 12, 2025

@damencho i fixed the lint and the test is also passing, could you please review it again? - ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Support to play Youtube video from specified time
3 participants