您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

functions.js 526B

12345678910111213141516171819
  1. // @flow
  2. import { NativeModules } from 'react-native';
  3. const pip = NativeModules.PictureInPicture;
  4. /**
  5. * Tells the application to enter the Picture-in-Picture mode, if supported.
  6. *
  7. * @returns {Promise} A promise which is fulfilled when PiP mode was entered, or
  8. * rejected in case there was a problem or it isn't supported.
  9. */
  10. export function enterPictureInPictureMode(): Promise<void> {
  11. if (pip) {
  12. return pip.enterPictureInPictureMode();
  13. }
  14. return Promise.reject(new Error('PiP not supported'));
  15. }