Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
snowinszu committed Jun 30, 2017
1 parent a45393c commit dfdfffe
Show file tree
Hide file tree
Showing 6,960 changed files with 924,101 additions and 110 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
165 changes: 134 additions & 31 deletions .idea/workspace.xml

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions dist/pear-player.min.js

Large diffs are not rendered by default.

52 changes: 15 additions & 37 deletions docs/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var xhr = new XMLHttpRequest();
//CP需要先登录来获取token
xhr.open("POST", 'https://api.webrtc.win:6601/v1/customer/login');
var data = JSON.stringify({
user:'admin',
user:'test',
password:'123456'
});
xhr.onload = function () {
Expand All @@ -42,10 +42,8 @@ xhr.onload = function () {
if (!!res.token){
console.log('token:' +res.token);

var player = new PearPlayer('#pearvideo', {//第一个参数为video标签的id或class
var player = new PearPlayer('#pearvideo', res.token, {//第一个参数为video标签的id或class
type: 'mp4',                           //播放视频的类型,目前只能是mp4
src: 'https://example.com/v1.mp4', //视频播放的src
token: res.token, //与信令服务器连接的token,必须
algorithm: 'firstaid', //核心算法,默认firstaid
autoplay: true,                       //是否自动播发视频,默认true
chunkSize: 1*1024*1024,               //每个chunk的大小,必须是32K的整数倍,默认1M
Expand Down Expand Up @@ -129,37 +127,20 @@ function onBufferSources(bufferSources) { //s: server n: node d: data chan
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Client</title>
<title>Pear Player</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
/*.start{*/
/*background: greenyellow; width: 50px; height: 25px; line-height: 25px; text-align: center;*/
/*}*/
body{
display: flex;
flex-direction: column;
align-items: center; /*定义body的元素垂直居中*/
justify-content: center; /*定义body的里的元素水平居中*/
width: 100%;
height: 100%;
}
#pearvideo{
margin: 0 auto;
}
</style>
</head>
<body>
<div id="main">
<video id="pearvideo" loop="true" controls>
<video id="pearvideo" src="https://qq.webrtc.win/tv/pear001.mp4" controls>
</video>
</div>
<script src="../pear-player.js"></script>
<script>
var xhr = new XMLHttpRequest();
xhr.open("POST", 'https://api.webrtc.win:6601/v1/customer/login');
var data = JSON.stringify({
user:'admin',
user:'test',
password:'123456'
});
xhr.onload = function () {
Expand All @@ -168,11 +149,8 @@ function onBufferSources(bufferSources) { //s: server n: node d: data chan
var res = JSON.parse(this.response);
if (!!res.token){
console.log('token:' +res.token);
var player = new PearPlayer('#pearvideo', { //第一个参数为video标签的id或class
type: 'mp4', //播放视频的类型,目前只能是mp4
src: 'https://qq.webrtc.win/tv/pear001.mp4', //视频播放的src
token: res.token, //与信令服务器连接的token,必须
//第一个参数为video标签的id或class
var player = new PearPlayer('#pearvideo', res.token, {
algorithm: 'firstaid', //核心算法,默认firstaid
autoplay: true, //是否自动播发视频,默认true
chunkSize: 1*1024*1024, //每个chunk的大小,必须是32K的整数倍,默认1M
Expand All @@ -184,14 +162,14 @@ function onBufferSources(bufferSources) { //s: server n: node d: data chan
useMonitor: true //是否开启monitor,会稍微影响性能,默认true
});
player.on('exception', onException);
player.on('begin', onBegin);
player.on('progress', onProgress);
player.on('cloudspeed', onCloudSpeed);
player.on('fogspeed', onFogSpeed);
player.on('fograte', onWebRTCRate);
player.on('buffersources', onBufferSources); //s: server n: node d: data channel b: browser
player.on('done', onDone);
player.on('exception', onException); //播放器出现异常时的回调函数
player.on('begin', onBegin);              //开始下载时触发
player.on('progress', onProgress); //回调目前的下载进度
player.on('cloudspeed', onCloudSpeed); //来自server的HTTP的平均下载速度
player.on('fogspeed', onFogSpeed); //来自fog的节点(包括HTTP和WebRTC)的平均下载速度
player.on('fograte', onWebRTCRate);          //fog节点的下载比率(下载的字节数除以总的字节数)
player.on('buffersources', onBufferSources); //buffer map,记录每个buffer的下载源类型,其中s: server n: node d: data channel b: browser
player.on('done', onDone);         //结束下载时触发
}
} else {
Expand Down
1 change: 1 addition & 0 deletions node_modules/.bin/acorn

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/atob

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/bin-version-check

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/bittorrent-tracker

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/cleancss

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/create-torrent

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/csso

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/escodegen

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/esgenerate

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/esparse

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/esvalidate

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/executable

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/find-versions

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/gifsicle

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/gulp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/he

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/html-minifier

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/jpegtran

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/js-yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/lpad-align

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/mime

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/mkdirp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/ncp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/optipng

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/parse-torrent

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/prebuild-install

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/pretty-bytes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/rc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/rimraf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/seek-bunzip

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/seek-table

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/sshpk-conv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/sshpk-sign

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/sshpk-verify

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/strip-bom

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/strip-dirs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/strip-indent

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/svgo

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/uglifyjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/user-home

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/uuid

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/which

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/acorn/.editorconfig

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/acorn/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions node_modules/acorn/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/acorn/.tern-project

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions node_modules/acorn/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions node_modules/acorn/AUTHORS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions node_modules/acorn/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dfdfffe

Please sign in to comment.