tt.navigateToVideoView

2020-02-14 23:41 更新

tt.navigateToVideoView(Object obj)

跳轉(zhuǎn)到分享的視頻播放頁面


輸入

繼承標(biāo)準(zhǔn)對象輸入, 擴展屬性描述:

屬性數(shù)據(jù)類型默認(rèn)值是否必填描述
videoIdstring-tt.shareAppMessage分享視頻成功后返回


輸出

fail 回調(diào)函數(shù)返回的錯誤代碼:

errCode描述
1001videoId 類型不正確
1002視頻已經(jīng)被刪除
1003videoId 不正確
1004獲取視頻信息錯誤
1005其他錯誤
1006網(wǎng)絡(luò)錯誤
1007端上其他錯誤
1008端上參數(shù)錯誤


示例代碼

tt.shareAppMessage({
  channel: "video",
  title: "測試分享視頻",
  desc: "測試描述",
  imageUrl: "",
  templateId: "", // 替換成通過審核的分享ID
  query: "",
  extra: {
    videoPath: "ttfile://temp/test.mp4", // 可替換成錄屏得到的視頻地址
    videoTopics: ["話題1", "話題2"],
    withVideoId: true
  },
  success(res) {
    console.log(res.videoId);
    console.log("分享視頻成功");
  },
  fail(e) {
    console.log("分享視頻失敗");
  }
});

tt.navigateToVideoView({
  videoId: "xxxxxx",
  success: res => {
    console.log("done");
  },
  fail: err => {
    if (err.errCode === 1006) {
      tt.showToast({
        title: "something wrong with your network"
      });
    }
  }
});
以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號