import { getInstance } from '../instance' ; static default let PLAY_ID = 0 ; memberof param url param { Function } callback return function playOnce ( url , callback ? ) { const alias = `alias${ PLAY_ID ++ }` ; getInstance ( ) . add ( alias , { url , preload : true , autoPlay : true , loaded : ( err ) => { if ( err ) { console . error ( err ) ; getInstance ( ) . remove ( alias ) ; if ( callback ) { callback ( err ) ; } } } , complete : ( ) => { getInstance ( ) . remove ( alias ) ; if ( callback ) { callback ( null ) ; } } , } ) ; return alias ; } export { playOnce , PLAY_ID } ;