Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 package org.chromium.media; | |
| 6 | |
| 7 import android.content.Context; | |
| 8 import android.media.MediaPlayer; | |
| 9 import android.net.Uri; | |
| 10 import android.text.TextUtils; | |
| 11 | |
| 12 import java.util.HashMap; | |
| 13 | |
| 14 import org.chromium.base.CalledByNative; | |
| 15 import org.chromium.base.JNINamespace; | |
| 16 | |
| 17 @JNINamespace("media") | |
| 18 class MediaPlayerBridge { | |
| 19 @CalledByNative | |
| 20 private static boolean setDataSource(MediaPlayer player, Context context, St ring url, | |
| 21 String cookies, boolean hideUrlLog) { | |
| 22 Uri uri = Uri.parse(url); | |
| 23 HashMap headersMap = new HashMap<String, String>(); | |
| 24 if (hideUrlLog) | |
| 25 headersMap.put("x-hide-urls-from-log", "true"); | |
| 26 if (!TextUtils.isEmpty(cookies)) | |
| 27 headersMap.put("Cookie", cookies); | |
| 28 try { | |
| 29 player.setDataSource(context, uri, headersMap); | |
|
scherkus (not reviewing)
2012/09/20 19:13:55
should these be 4 space indent?
bulach
2012/09/21 10:10:26
Done.
| |
| 30 return true; | |
| 31 } catch (Exception e) { | |
| 32 return false; | |
| 33 } | |
| 34 } | |
| 35 } | |
| OLD | NEW |