Back to project page Demo-YouTuBe-Android.
The source code is released under:
Apache License
If you think the Android project Demo-YouTuBe-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.lqg.youtube.support.player; /*from w ww .j av a2 s .co m*/ import java.util.HashMap; import java.util.Map; /** * Represents a video stream */ public class VideoStream { protected String mUrl; /** * Construct a video stream from one of the strings obtained * from the "url_encoded_fmt_stream_map" parameter if the video_info * * @param pStreamStr - one of the strings from "url_encoded_fmt_stream_map" */ public VideoStream(String pStreamStr) { String[] lArgs = pStreamStr.split("&"); Map<String, String> lArgMap = new HashMap<String, String>(); for (int i = 0; i < lArgs.length; i++) { String[] lArgValStrArr = lArgs[i].split("="); if (lArgValStrArr != null) { if (lArgValStrArr.length >= 2) { lArgMap.put(lArgValStrArr[0], lArgValStrArr[1]); } } } mUrl = lArgMap.get("url"); } public String getUrl() { return mUrl; } }