php - how to auto add multiple youtube video id to jw player and play them sequentially? -
I would like to receive this post to post many YouTube IDs in WordPress, something like "3jSDiJ, DJIJWK, JDIAZ" And I want to load them in the JW Player and run them in sequential order.
I must first be able to figure out how many ',' there are so that in the JW Player code I
{'file': 'http: // www Can make a loop to make multiple of '.youtube.com / v? 3SJDDJ'. ,} This is an example of two videos
& lt; Script type = "text / javascript" & gt; Jwplayer ("Container") Setup ({'Flashplayer': 'jwplayer.swf', 'playlist': [{'file': 'http://www.youtube.com/v?3jSDiJ',}, 'file ':' Http: //www.youtube.cmo/v? 3jSDiJ ',}], repeat:' list '}); & Lt; / Script & gt; Your suggestion and support is appreciated
Not really, enough information has been given to ensure this, but assuming that the YouTube ID is being stored in an array, you can do something like this -
$ youtubeids = Array ('3jSDiJ', 'DJIJWk', 'Jediage'); Foreign currency ($ youtubeids $ youtubeid) {echo "'file': 'http: //www.youtube.cmo/v?'. Youtubeid.", ";} < P> Just put this code so that it can print the output in your javascript.
Comments
Post a Comment