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

Ability to set header or custom component for poster #3013

Closed
ahmeturganci opened this issue Jan 27, 2023 · 2 comments · Fixed by #3972
Closed

Ability to set header or custom component for poster #3013

ahmeturganci opened this issue Jan 27, 2023 · 2 comments · Fixed by #3972

Comments

@ahmeturganci
Copy link

Feature Request

Why it is needed

Constantly the same posters can be boring in dynamic applications, so a structure like on source for posters or structures where we can show our custom own components as posters will be nice and simple to use. Long story short :D
It would be great if we can switch to a structure where we can pass header just like on source

Possible implementation

Code sample


<Video
          uri: podCasturl,//here is the,
          headers: {
            access_token: accessToken, // token for reach our api
          },
        }}
        poster={{
          uri: podCasturl,//here is the,
          headers: {
            access_token: accessToken, // token for reach our api
          },
        }}
        posterResizeMode="center"
      />

or


const renderCustomPoster = () => {
    return (<Image />) // here custom images how developer needs
}
<Video
          uri: podCasturl,//here is the,
          headers: {
            access_token: accessToken, // token for reach our api
          },
        }}
        poster={renderCustomPoster()}
        posterResizeMode="center"
      />
@freeboub
Copy link
Collaborator

I understand the issue, and I think you can have a look to Video.js file (this is full js feature).

poster is displayed like this:

        {this.state.showPoster && (
          <Image style={posterStyle} source={{ uri: this.props.poster }} />
        )}

you can extend RNV api to add a prop:

posterProps:{{ 
          headers: {
            access_token: accessToken, // token for reach our api
          },
}}

And than:


        {this.state.showPoster && (
          <Image style={posterStyle} source={{ uri: this.props.poster }} {...posterProps} />
        )}

I PR would be welcome ! :)

@moskalakamil
Copy link
Member

@ahmeturganci the feature has just been merged. It will be enabled in the next release. You can read more here: #3972 :))

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