Skip to content
On this page

Share Video

shareVideo

Shares video to a specific scene.

Type

typescript
function shareVideo(request: {
  videoUrl: string;
  scene: number;
  title?: string;
  description?: string;
  videoLowBandUrl?: string;
  coverUrl?: string;
}): Promise<boolean>;

Parameters

NameTypeRequiredDefault ValueDescription
videoUrlStringYes/URL for the video to be shared.
titleStringNo/Message title.
descriptionStringNo/Description.
videoLowBandUrlStringNo/URL for the Video in the low bandwidth environment.
coverUrlStringNo/Message cover image.
sceneNumberYes/Share to Chat:
NativeWechatConstants.WXSceneSession
Share on Moments:
NativeWechatConstants.WXSceneTimeline
Shared to Favorites:
NativeWechatConstants.WXSceneFavorite

Example

typescript
import {shareVideo, NativeWechatConstants} from 'native-wechat';

shareVideo({
      title:'Hectors Birthday Video',
      description:'A goods thing to watch',
      videoUrl:'https://hector.im/video.mp4',
      videoLowBandUrl:'https://hector.im/video_small.mp4',
      scene:NativeWechatConstants.WXSceneFavorite
})

Released under the MIT License.