| | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.Log; |
| | | import android.webkit.JavascriptInterface; |
| | | import android.widget.Toast; |
| | | |
| | |
| | | import org.json.JSONException; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.net.URLEncoder; |
| | | import java.util.Iterator; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.Map; |
| | |
| | | import static android.content.Context.MODE_PRIVATE; |
| | | |
| | | public class PPJavaInterface { |
| | | private static final String TAG = "PPJavaInterface"; |
| | | private Context mContext; |
| | | private IEventListener eventListener; |
| | | |
| | |
| | | } else { |
| | | root.put("code", 1); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("code", user.getPptvUid()); |
| | | data.put("code", user.getPptvCode()); |
| | | data.put("nickname", user.getNickName()); |
| | | data.put("isSVip", (user.getVipExpireTime() != null && user.getVipExpireTime() > System.currentTimeMillis())); |
| | | data.put("isSVip", UserUtil.isVIP(mContext)); |
| | | data.put("isCoupon", false); |
| | | root.put("data", data); |
| | | } |
| | |
| | | eventListener.onPlayFinish(); |
| | | } |
| | | |
| | | /** |
| | | * 视频信息回调 |
| | | * |
| | | * @param name 视频名称 |
| | | * @param cid |
| | | * @param vid |
| | | */ |
| | | @JavascriptInterface |
| | | public void videoInfo(String name, String cid, String vid) { |
| | | |
| | | } |
| | | |
| | | |
| | | public interface IEventListener { |
| | | public void onLogin(); |
| | | |