as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
原生
Skip to main content

Add VideoPlaybackScreen to Stack.Navigator

Now that we have a VideoPlayback screen we need to add it to our Stack.Navigator so that we can access it as part of our Navigation.
  • Open App.tsx.
  • Import the VideoPlaybackScreen from screens
  • Add a new Stack.Screen called VideoPlaybackScreen and set it to render the new VideoPlaybackScreen component.
Now we can launch our VideoPlaybackScreen when we click on the “Watch now button”
  • Open VideoDetailScreen.tsx
  • Update the pressFunction of the “Watch Now” button to navigate to the VideoPlayerScreen
  • Give the navigation a prop of videoURL and set it to the value of videoURL

Launch VideoPlaybackScreen

Now that we are passing data to VideoPlaybackScreen, let’s display it.
  • Open VideoPlaybackScreen.tsx.
  • Add the navigation and route props to the screen { navigation, route }: any.
  • Set the Text to route.params.videoURL.
The updated code in VideoPlaybackScreen.tsx should look like this:
Video screen with URI

Video screen with URI

Congratulations! You’ve successfully completed the Vega Video App tutorial! 🎉 Your Vega app now has the essential functionality to display and play videos with proper navigation between screens. You’ve built a solid foundation for a video streaming application. Head over to the next page to see how you can continue your Vega journey.
最后修改于 2026年2月9日