html5 canvas 直播,HTML5 使用Canvas播放视频+视频播放控制器

JavaScript语言:JaveScriptBabelCoffeeScript确定/*CanvasFilmMovieCopyright(c) 2015 SHIFTBRAIN - Tsukasa TokuraThis software is released under the MIT License.http://opensource.org/licenses/mit-license.php*/...
摘要由CSDN通过智能技术生成

JavaScript

语言:

JaveScriptBabelCoffeeScript

确定

/*

CanvasFilmMovie

Copyright(c) 2015 SHIFTBRAIN - Tsukasa Tokura

This software is released under the MIT License.

http://opensource.org/licenses/mit-license.php

*/

(function() {

var CanvasFilmMovie,

bind = function(fn, me) {

return function() {

return fn.apply(me, arguments);

};

},

slice = [].slice;

CanvasFilmMovie = (function() {

CanvasFilmMovie.prototype.defaults = {

acTime: 3,

acEasing: $.easing.easeInSine,

deTime: 2,

deEasing: $.easing.easeOutSine,

offsetValue: 1,

targetImgArray: [],

sceneWidth: false,

sceneHeight: false,

fps: 30

};

function CanvasFilmMovie(_$targetParent, options) {

this.changeFps = bind(this.changeFps, this);

this.spriteClear = bind(this.spriteClear, this);

this._drawLoop = bind(this._drawLoop, this);

this.drawLoopStop = bind(this.drawLoopStop, this);

this.drawLoopStart = bind(this.drawLoopStart, this);

this.drawLoopSpeedDown = bind(this.drawLoopSpeedDown, this);

this.drawLoopSpeedUp = bind(this.drawLoopSpeedUp, this);

this._canvasResize = bind(this._canvasResize, this);

this.options = $.extend({}, this.defaults, options);

this.imgWidth = null;

this.imgHeight = null;

this.canvasPointArray = [];

this.imgPointArray = [];

this.canvasPanelWidth = null;

this.canvasXPanelNum = null;

this.imgPanelresizedWidth = null;

this.imgXPanelNum = null;

this.imgYPanelNum = null;

this.acSpeedArray = [];

this.deSpeedArray = [];

this.currentFrame = 0;

this.vector = 1;

this.nowSpeed = 0;

this.stopping = false;

this.isDrawed = false;

this.$targetParent = _$targetParent;

this.canvas = null;

this.ctx = null;

this.requestId = null;

this.setTimerId = null;

this.fpsInterval = 1000 / this.options.fps;

this.timeLog = Date.now();

this.requestAnimationFrame = (window.requestAnimationFrame && window.requestAnimationFrame.bind(window)) || (window.webkitRequestAnimationFrame && window.webkitRequestAnimationFrame.bind(window)) || (window.mozRequestAnimationFrame && window.mozRequestAnimationFrame.bind(window)) || (window.oRequestAnimationFrame && window.oRequestAnimationFrame.bind(window)) || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window)) || function(callback, element) {

return this.setTimerId = window.setTimeout(callback, 1000 / 60);

};

this.cancelAnimationFrame = (window.cancelAnimationFrame && window.cancelAnimationFrame.bind(window)) || (window.webkitCancelAnimationFrame && window.webkitCancelAnimationFrame.bind(window)) || (window.mozCancelAnimationFrame && window.mozCancelAnimationFrame.bind(window)) || (window.oCancelAnimationFrame && window.oCancelAnimationFrame.bind(window)) || (window.msCance

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值