Android Open Source - Demo-YouTuBe-Android Video Stream






From Project

Back to project page Demo-YouTuBe-Android.

License

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.

Java Source Code

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;
    }
}




Java Source Code List

com.lqg.youtube.support.GlobalApplication.java
com.lqg.youtube.support.http.Search.java
com.lqg.youtube.support.player.Format.java
com.lqg.youtube.support.player.UrlParser.java
com.lqg.youtube.support.player.VideoId.java
com.lqg.youtube.support.player.VideoStream.java
com.lqg.youtube.support.util.ImageLoaderUtil.java
com.lqg.youtube.support.util.LogUtil.java
com.lqg.youtube.support.util.SearchSetting.java
com.lqg.youtube.ui.play.PlayVideoUsingVideoViewActivity.java
com.lqg.youtube.ui.play.PlayVideoUsingYouTuBeActivity.java
com.lqg.youtube.ui.search.MainActivity.java
com.lqg.youtube.ui.search.SearchFragment.java
com.lqg.youtube.ui.search.SearchResultAdapter.java
com.lqg.youtube.ui.search.SearchSetingFragment.java