| | |
| | | * WFS interface, Jeff Yang 2016.10 |
| | | */ |
| | | /* eslint-disable */ |
| | | 'use strict'; |
| | | "use strict"; |
| | | |
| | | import Event from './events'; |
| | | import FlowController from './controller/flow-controller'; |
| | | import BufferController from './controller/buffer-controller'; |
| | | import EventEmitter from 'events'; |
| | | import Event from "./events"; |
| | | import FlowController from "./controller/flow-controller"; |
| | | import BufferController from "./controller/buffer-controller"; |
| | | import EventEmitter from "events"; |
| | | // import XhrLoader from './utils/xhr-loader'; |
| | | import WebsocketLoader from './loader/websocket-loader'; |
| | | import WebsocketLoader from "./loader/websocket-loader"; |
| | | |
| | | class Wfs { |
| | | static get version() { |
| | | // replaced with browserify-versionify transform |
| | | return '__VERSION__' + 'v.0.0.0.1'; |
| | | return "__VERSION__" + "v.0.0.0.1"; |
| | | } |
| | | |
| | | static isSupported() { |
| | | return ( |
| | | window.MediaSource && |
| | | typeof window.MediaSource.isTypeSupported === 'function' && |
| | | window.MediaSource.isTypeSupported( |
| | | 'video/mp4; codecs="avc1.42c01f,mp4a.40.2"' |
| | | ) |
| | | typeof window.MediaSource.isTypeSupported === "function" && |
| | | window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42c01f,mp4a.40.2"') |
| | | ); |
| | | } |
| | | |
| | |
| | | this.websocketLoader = new WebsocketLoader(this); |
| | | this.mediaType = undefined; |
| | | this.cameraInfo = {}; |
| | | this.playerStatus = -1; |
| | | } |
| | | |
| | | destroy() { |
| | |
| | | this.websocketLoader.destroy(); |
| | | } |
| | | |
| | | attachMedia( |
| | | media, |
| | | channelName = 'chX', |
| | | mediaType = 'H264Raw', |
| | | websocketName = 'ws', |
| | | cameraInfo = {} |
| | | ) { |
| | | attachMedia(media, channelName = "chX", mediaType = "H264Raw", websocketName = "ws", cameraInfo = {}) { |
| | | // 'H264Raw' 'FMp4' |
| | | this.mediaType = mediaType; |
| | | this.media = media; |