videojs-player icon indicating copy to clipboard operation
videojs-player copied to clipboard

the solution for <The "flash" tech is undefined... ...>

Open AimLuo opened this issue 4 years ago • 2 comments

背景

看了这里https://github.com/surmon-china/vue-video-player/issues/221#issuecomment-629764501 的方案,自己测试过后,发现可能会对某些其他第三方库的引用造成影响。

解决方案(the solution)

yarn add [email protected]

问题分析

从上面的问题描述,发现根本原因就是video.js和videojs-flash的版本对不上,我们来仔细梳理下, 以下操作通过yarn执行 vue-video-player的依赖如下:

"dependencies": {
    "video.js": "^6.6.0",
    "videojs-flash": "^2.1.0",
    .......
  },

安装vue-video-player时,会自动安装"video.js"6系列的最大版本,即’6.13.0‘,而videojs-flash会安装2系列的最大版本,即2.2.1, 去查看[email protected]的依赖:

  "dependencies": {
    "video.js": "^6 || ^7",
    ......
  },

[email protected]会自动安装video.js^7的版本,我们去node_modules中查看[email protected]node_modules即可发现此时安装有video.js,并且他的版本号是7系列的。 而我们要使用的是video.js6系列,这就会造成冲突。 此时我们去查看[email protected]的依赖如下:

  "dependencies": {
    "video.js": "^6.1.0",
    ......
  },

所以我们安装[email protected]即可

AimLuo avatar May 18 '20 01:05 AimLuo

尝试N次依然不行

531431988 avatar May 21 '20 04:05 531431988

"videojs-flash": "^2.2.1"、"video.js": "^7.9.7" 可以。没有使用vue-video-player

1103409364 avatar Oct 20 '20 11:10 1103409364