mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 14:41:20 -08:00
调整目录
This commit is contained in:
1 parent
f63ae33be7
commit
52458bb95e
7 files changed
+60
-17
No files matched your search
@@ -1,6 +1,11 @@
|
||||
export default {
|
||||
mediaSource: {
|
||||
propertys: ['activeSourceBuffers', 'duration', 'readyState', 'sourceBuffers'],
|
||||
propertys: [
|
||||
'activeSourceBuffers',
|
||||
'duration',
|
||||
'readyState',
|
||||
'sourceBuffers',
|
||||
],
|
||||
methods: [
|
||||
'addSourceBuffer',
|
||||
'endOfStream',
|
||||
@@ -8,7 +13,11 @@ export default {
|
||||
'clearLiveSeekableRange',
|
||||
'setLiveSeekableRange',
|
||||
],
|
||||
events: ['sourceclose', 'sourceended', 'sourceopen'],
|
||||
events: [
|
||||
'sourceclose',
|
||||
'sourceended',
|
||||
'sourceopen',
|
||||
],
|
||||
},
|
||||
sourceBuffer: {
|
||||
propertys: [
|
||||
@@ -23,11 +32,27 @@ export default {
|
||||
'appendWindowEnd',
|
||||
'trackDefaults',
|
||||
],
|
||||
methods: ['appendBuffer', 'appendStream', 'abort', 'remove'],
|
||||
events: ['abort', 'error', 'update', 'updateend', 'updatestart'],
|
||||
methods: [
|
||||
'appendBuffer',
|
||||
'appendStream',
|
||||
'abort',
|
||||
'remove',
|
||||
],
|
||||
events: [
|
||||
'abort',
|
||||
'error',
|
||||
'update',
|
||||
'updateend',
|
||||
'updatestart',
|
||||
],
|
||||
},
|
||||
sourceBufferList: {
|
||||
propertys: ['length'],
|
||||
events: ['addsourcebuffer', 'removesourcebuffer'],
|
||||
propertys: [
|
||||
'length',
|
||||
],
|
||||
events: [
|
||||
'addsourcebuffer',
|
||||
'removesourcebuffer',
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -3,12 +3,21 @@ import config from './config';
|
||||
export default class CreatMediaSource {
|
||||
constructor(flv) {
|
||||
this.flv = flv;
|
||||
this.creatUrl();
|
||||
this.eventBind();
|
||||
}
|
||||
|
||||
creatUrl() {
|
||||
const {
|
||||
mediaElement,
|
||||
events: { destroyEvents },
|
||||
} = this.flv;
|
||||
this.mediaSource = new MediaSource();
|
||||
const url = URL.createObjectURL(this.mediaSource);
|
||||
flv.events.destroyEvents.push(() => {
|
||||
destroyEvents.push(() => {
|
||||
URL.revokeObjectURL(url);
|
||||
});
|
||||
flv.mediaElement.src = url;
|
||||
mediaElement.src = url;
|
||||
}
|
||||
|
||||
eventBind() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Emitter from 'tiny-emitter';
|
||||
import checkSupport from './checkSupport';
|
||||
import checkSupport from './utils/checkSupport';
|
||||
import EventProxy from './eventProxy';
|
||||
import CreatMediaSource from './creatMediaSource';
|
||||
import * as utils from './utils';
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { errorHandle } from './utils';
|
||||
import { errorHandle } from '.';
|
||||
|
||||
export default function checkSupport(mediaElement, url) {
|
||||
errorHandle(mediaElement instanceof HTMLVideoElement, 'The first parameter is not a video tag element');
|
||||
File renamed without changes.
Reference in new issue
Block a user