Set jw player youtube video playback quality

后端 未结 2 1446
一整个雨季
一整个雨季 2021-01-15 11:40

I\'m using jw player to play youtube videos, but i need for the video to start playing in hd ( 720p ) i use the following code:

<
2条回答
  •  半阙折子戏
    2021-01-15 12:37

    setPlaybackQuality is not a valid API call - http://www.longtailvideo.com/support/jw-player/28851/javascript-api-reference

    Here is a list of valid quality API calls:

    Quality
    
    These API calls are used to listen to or update the video quality if multiple quality levels of a video are provided.
    
    getQualityLevels()
        Returns an array with quality levels from the player. Each level is an object that contains a label property. 
    getCurrentQuality()
        Returns the index of the currently active quality level. 
    
    setCurrentQuality(index)
        Change the quality level to the provided index. The index must be within the list provided by getQualityLevels. 
    
    onQualityLevels(callback)
        Fired when the list of available quality levels is updated. Happens e.g. shortly after a playlist item starts playing. Event attributes:
    
            levels (Array): the full array with new quality levels. 
    
    onQualityChange (callback)
        Fired when the active quality level is changed. Happens in respons to e.g. a user clicking the controlbar quality menu or a script calling setCurrentQuality. Event attributes:
    
            currentQuality (Number): index of the new quality level in the getQualityLevels() array. 
    

提交回复
热议问题