Skip to content

Commit

Permalink
feat(xgplayer): v1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangxin92 committed Feb 27, 2019
1 parent 03ae6fb commit 0eb9e7a
Show file tree
Hide file tree
Showing 41 changed files with 659 additions and 558 deletions.
10 changes: 3 additions & 7 deletions packages/xgplayer-dash/browser/index.js

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions packages/xgplayer-dash/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer-dash/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-dash",
"version": "1.1.4-beta.2",
"version": "1.1.4",
"description": "xgplayer plugin for MPEG-DASH",
"main": "./dist/index.js",
"scripts": {
Expand Down
7 changes: 3 additions & 4 deletions packages/xgplayer-flv.js/browser/index.js

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions packages/xgplayer-flv.js/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer-flv.js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-flv.js",
"version": "1.1.3",
"version": "1.1.4",
"description": "web video player",
"main": "./dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/xgplayer-flv/browser/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer-flv/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer-flv/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-flv",
"version": "1.1.4-beta",
"version": "1.1.4",
"description": "flv demuxer for xgplayer",
"main": "./dist/index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/xgplayer-hls.js/browser/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/xgplayer-hls.js/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer-hls.js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-hls.js",
"version": "1.1.4-beta.1",
"version": "1.1.5-beta.1",
"description": "xgplayer plugin for hls",
"main": "./dist/index.js",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion packages/xgplayer-hls.js/src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import Player from 'xgplayer'
import Hls from 'hls.js'
import utils from './utils'

class HlsJsPlayer extends Player {
constructor (options) {
super(options)
this.hlsOpts = options.hlsOpts || {}
let util = Player.util
let player = this
if (Player.sniffer.device === 'mobile' && navigator.platform !== 'MacIntel' && navigator.platform !== 'Win32') {
this.browser = utils.getBrowserVersion()
if ((Player.sniffer.device === 'mobile' && navigator.platform !== 'MacIntel' && navigator.platform !== 'Win32') || this.browser.indexOf('Safari') > -1) {
return
}
let hls
Expand Down
44 changes: 44 additions & 0 deletions packages/xgplayer-hls.js/src/utils/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
let util = {}

util.getBrowserVersion = function () {
let userAgent = navigator.userAgent //取得浏览器的userAgent字符串

if (userAgent.indexOf("Firefox") > -1) {
let version = userAgent.match(/firefox\/[\d.]+/gi)[0].match(/[\d]+/)[0]
return "Firefox "+version
} else if (userAgent.indexOf("Edge") > -1) {
let version = userAgent.match(/edge\/[\d.]+/gi)[0].match(/[\d]+/)[0]
return "Edge "+version
} else if (userAgent.indexOf("rv:11") > -1) {
return "IE 11"
} else if (userAgent.indexOf("Opera") > -1 || userAgent.indexOf("OPR") > -1) {
if (userAgent.indexOf("Opera") > -1) {
let version = userAgent.match(/opera\/[\d.]+/gi)[0].match(/[\d]+/)[0]
return "Opera "+version
}
if (userAgent.indexOf("OPR") > -1) {
let version = userAgent.match(/opr\/[\d.]+/gi)[0].match(/[\d]+/)[0]
return "Opera "+version
}
} else if (userAgent.indexOf("Chrome") > -1) {
let version = userAgent.match(/chrome\/[\d.]+/gi)[0].match(/[\d]+/)[0]
return "Chrome "+version
} else if (userAgent.indexOf("Safari") > -1) {
let version = userAgent.match(/safari\/[\d.]+/gi)[0].match(/[\d]+/)[0]
return "Safari "+version
} else if (userAgent.indexOf("MSIE") > -1 || userAgent.indexOf("Trident") > -1) {
if (userAgent.indexOf("MSIE") > -1) {
let version = userAgent.match(/msie [\d.]+/gi)[0].match(/[\d]+/)[0]
return "IE "+version
}
if (userAgent.indexOf("Trident") > -1) {
let versionTrident = userAgent.match(/trident\/[\d.]+/gi)[0].match(/[\d]+/)[0]
let version = parseInt(versionTrident) + 4
return "IE "+version
}
} else {
return "Unknown"
}
}

export default util
2 changes: 1 addition & 1 deletion packages/xgplayer-hls/browser/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer-hls/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer-hls/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-hls",
"version": "1.1.3",
"version": "1.1.4",
"description": "xgplayer plugin for hls",
"main": "./dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/xgplayer-logger/browser/xgplayer-logger.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer-logger/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer-logger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-logger",
"version": "1.1.4-beta",
"version": "1.1.4",
"description": "video player logger",
"main": "./dist/index.js",
"directories": {
Expand Down
Loading

0 comments on commit 0eb9e7a

Please sign in to comment.