GithubHelp home page GithubHelp logo

vod-js-sdk-v6's Introduction

vod-js-sdk-v6

Web SDK for Tencent Cloud Video Service

Document: https://cloud.tencent.com/document/product/266

Install

npm install vod-js-sdk-v6

For browser, there is a umd bundle: dist/vod-js-sdk-v6.js

We use Promise in the source code. You should imoprt Promise polyfill when target legacy browsers.

Demo

demo https://tencentyun.github.io/vod-js-sdk-v6/

demo source code https://github.com/tencentyun/vod-js-sdk-v6/blob/master/docs/index.html

import usage demo: https://github.com/tencentyun/vod-js-sdk-v6/tree/master/docs/import-demo

troubleshooting https://github.com/tencentyun/vod-js-sdk-v6/wiki/%E5%B8%B8%E8%A7%81%E6%95%85%E9%9A%9C%E6%8E%92%E6%9F%A5

Usage

  • NOTICE: Document may be outdated, but demo and source code are always latest*

See: https://cloud.tencent.com/document/product/266/9239

Contributing

  1. git clone this project
  2. npm install
  3. npm run test
  4. add more task cases

vod-js-sdk-v6's People

Contributors

alsotang avatar tcplayer avatar zwaittt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vod-js-sdk-v6's Issues

视频上传出错!

技术vue2.5 vue-cli3 webpack4+, vod-js-sdk-v6 1.4.3

使用中的问题
1.10001 ugc upload | invalid request, 包含你们自己的demo也会出现问题, 签名正常, 已用script导入的类型验证过了

require.js 和 vod js sdk 冲突

我有一个页面使用了require.js, 在引入vod js sdk报错

Uncaught Error: Mismatched anonymous define() module: function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,

没有办法用

微信浏览器中上传不了

这个demo在微信浏览器里是可以正常上传的,但是下载下来就传不动,一直显示上传中,请问是怎么回事。

视频上传中断

image

onCosUpload TypeError: Cannot read property 'Code' of undefined
    at VodReporter.onCosUpload (vod_reporter.js?e573:100)
    at Uploader.emit (events.js?bf30:146)
    at eval (uploader.js?facb:366)
    at Object._callback [as callback] (util.js?c089:350)
    at eval (task.js?d062:85)
    at Array.eval (advance.js?6cac:26)
    at EventProxy.cos.emit (event.js?29ae:24)
    at eval (advance.js?6cac:85)
    at eval (advance.js?6cac:627)
    at eval (async.js?4a99:22)

vod_reporter.js引起的跨域问题

1.在项目中引用SDK,报Access to XMLHttpRequest at 'https://vodreport.qcloud.com/ugcupload_new' from origin 'http://xxx.xxx.cn' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute
的跨域问题;

2.项目本身设置了axios.defaults.withCredentials = true

3.在vod_reporter.js的172增加axios_1.defaults.withCredentials = false,之后再进行打包,不再报跨域问题
VodReporter.prototype.send = function (reportData) {
if (util_1.default.isDev || util_1.default.isTest) {
console.log("send reportData", reportData);
return;
}
axios_1.defaults.withCredentials = false; //172行增加了这个
axios_1.default.post(this.reportUrl, reportData);
};

提问:针对这种情况,怎么处理合适呢?

紧急!上传失败:apply upload failed

代码:
import axios from 'axios';
import TcVod from 'vod-js-sdk-v6'

created() {
function getSignature() {
return axios.get('http://192.168.1.166/api/external/v1/VOD/uploadSignature').then(function(response) {
// console.log(response.data);
return response.data.data
})
}
this.tcVod = new TcVod({
getSignature: getSignature
})
console.log(this.tcVod);
},
methods: {
onUpload(e) {
const file = e.target.files[0]
const uploader = this.tcVod.upload({
videoFile: file // 视频,类型为 File
})
console.log(uploader); // 输出成功
uploader.on('video_upload', function(info) {
// uploaderInfo.isVideoUploadSuccess = true;
console.log(info);
})
console.log(uploader, 'uploader')
}
}

之后就报错:apply upload failed

Transcode

老版本的api提供了isTranscode参数,可以在上传完成后自动开始转码,在这一版的api没有提供类似参数?

vue上传视频进度条只在完成的时候调用到,中间无触发行为

image
image
如图所示,208M的视频上传过程中,进度只在视频上传完成的时候触发,看分片的请求没有返回值,不知道是不是这个原因。获取进度代码如下
uploader.on('video_progress', function (info) { console.log('video_progress', info) if (info.percent != undefined) { this.progress = Math.round(info.percent * 100) } })

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.