-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Apps for dev build: SDK SHA 833362f9 - Skin SHA caaf760f3
- Loading branch information
Showing
22 changed files
with
740 additions
and
431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
CompleteSampleApp/app/src/main/java/com/ooyala/sample/players/SampleVideoPlayerActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
package com.ooyala.sample.players; | ||
|
||
import android.app.Activity; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
|
||
import com.ooyala.android.OoyalaNotification; | ||
import com.ooyala.android.OoyalaPlayer; | ||
import com.ooyala.android.OoyalaPlayerLayout; | ||
import com.ooyala.android.PlayerDomain; | ||
import com.ooyala.android.ui.OoyalaPlayerLayoutController; | ||
import com.ooyala.android.util.SDCardLogcatOoyalaEventsLogger; | ||
import com.ooyala.sample.R; | ||
import com.ooyala.sample.utils.SampleVideoPlayerFactory; | ||
|
||
import java.util.Observable; | ||
import java.util.Observer; | ||
|
||
/** | ||
* This activity illustrates how you can integrate video player with | ||
* Ooyala SDK | ||
* | ||
*/ | ||
public class SampleVideoPlayerActivity extends Activity implements Observer { | ||
public final static String getName() { | ||
return "Custom Video Player Sample"; | ||
} | ||
final String TAG = this.getClass().toString(); | ||
private String EMBED = ""; | ||
String PCODE = null; | ||
String DOMAIN = null; | ||
|
||
protected OoyalaPlayer player; | ||
protected OoyalaPlayerLayoutController playerLayoutController; | ||
|
||
// Write the sdk events text along with events count to log file in sdcard if the log file already exists | ||
SDCardLogcatOoyalaEventsLogger playbacklog = new SDCardLogcatOoyalaEventsLogger(); | ||
|
||
/** | ||
* Called when the activity is first created. | ||
*/ | ||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.player_simple_layout); | ||
|
||
EMBED = getIntent().getExtras().getString("embed_code"); | ||
PCODE = getIntent().getExtras().getString("pcode"); | ||
DOMAIN = getIntent().getExtras().getString("domain"); | ||
|
||
OoyalaPlayerLayout playerLayout = (OoyalaPlayerLayout) findViewById(R.id.ooyalaPlayer); | ||
player = new OoyalaPlayer(PCODE, new PlayerDomain(DOMAIN)); | ||
playerLayoutController = new OoyalaPlayerLayoutController(playerLayout, player); | ||
// Below step will make sure that player is being chosen each time | ||
// make sure to put large integer value so that new player gets selected | ||
player.getMoviePlayerSelector().registerPlayerFactory(new SampleVideoPlayerFactory(999)); | ||
player.addObserver(this); | ||
|
||
|
||
if (player.setEmbedCode(EMBED)) { | ||
//Uncomment for Auto-Play | ||
//player.play(); | ||
} else { | ||
Log.d(this.getClass().getName(), "Something Went Wrong!"); | ||
} | ||
} | ||
|
||
@Override | ||
protected void onStop() { | ||
super.onStop(); | ||
if (player != null) { | ||
player.suspend(); | ||
} | ||
} | ||
|
||
@Override | ||
protected void onRestart() { | ||
super.onRestart(); | ||
if (player != null) { | ||
player.resume(); | ||
} | ||
} | ||
|
||
/** | ||
* Listen to all notifications from the OoyalaPlayer | ||
*/ | ||
@Override | ||
public void update(Observable arg0, Object argN) { | ||
final String arg1 = OoyalaNotification.getNameOrUnknown(argN); | ||
if (arg1 == OoyalaPlayer.TIME_CHANGED_NOTIFICATION_NAME) { | ||
return; | ||
} | ||
|
||
// Automation Hook: to write Notifications to a temporary file on the device/emulator | ||
String text="Notification Received: " + arg1 + " - state: " + player.getState(); | ||
// Automation Hook: Write the event text along with event count to log file in sdcard if the log file exists | ||
playbacklog.writeToSdcardLog(text); | ||
|
||
Log.d(TAG, "Notification Received: " + arg1 + " - state: " + player.getState()); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
CompleteSampleApp/app/src/main/java/com/ooyala/sample/utils/SampleVideoMoviePlayer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.ooyala.sample.utils; | ||
|
||
import com.ooyala.android.player.MoviePlayer; | ||
import com.ooyala.android.player.StreamPlayer; | ||
|
||
|
||
public class SampleVideoMoviePlayer extends MoviePlayer { | ||
|
||
@Override | ||
protected StreamPlayer createStreamPlayer() { | ||
return new SampleVideoStreamPlayer(); | ||
} | ||
|
||
} |
50 changes: 50 additions & 0 deletions
50
CompleteSampleApp/app/src/main/java/com/ooyala/sample/utils/SampleVideoPlayerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.ooyala.sample.utils; | ||
|
||
import com.ooyala.android.OoyalaException; | ||
import com.ooyala.android.item.Stream; | ||
import com.ooyala.android.player.MoviePlayer; | ||
import com.ooyala.android.player.PlayerFactory; | ||
import com.ooyala.android.player.StreamPlayer; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
/** | ||
* Create factory class for new player so that | ||
* it can be added into OoyalaPlayer | ||
*/ | ||
public class SampleVideoPlayerFactory implements PlayerFactory { | ||
|
||
private int priority; | ||
private Set<String> supportedFormats; | ||
|
||
|
||
public SampleVideoPlayerFactory(int priority) { | ||
this.priority = priority; | ||
this.supportedFormats = new HashSet<String>(); | ||
supportedFormats.add(Stream.DELIVERY_TYPE_DASH); | ||
supportedFormats.add(Stream.DELIVERY_TYPE_HLS); | ||
supportedFormats.add(Stream.DELIVERY_TYPE_M3U8); | ||
supportedFormats.add(Stream.DELIVERY_TYPE_MP4); | ||
} | ||
|
||
@Override | ||
public MoviePlayer createPlayer() throws OoyalaException { | ||
return new SampleVideoMoviePlayer(); | ||
} | ||
|
||
@Override | ||
public StreamPlayer createStreamPlayer() { | ||
return new SampleVideoStreamPlayer(); | ||
} | ||
|
||
@Override | ||
public int priority() { | ||
return priority; | ||
} | ||
|
||
@Override | ||
public Set<String> getSupportedFormats() { | ||
return supportedFormats; | ||
} | ||
} |
141 changes: 141 additions & 0 deletions
141
CompleteSampleApp/app/src/main/java/com/ooyala/sample/utils/SampleVideoStreamPlayer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
package com.ooyala.sample.utils; | ||
|
||
import android.content.Context; | ||
import android.graphics.Color; | ||
import android.net.wifi.WifiManager; | ||
import android.os.Handler; | ||
import android.os.Message; | ||
import android.view.Gravity; | ||
import android.view.ViewGroup; | ||
import android.widget.FrameLayout; | ||
import android.widget.LinearLayout; | ||
import android.widget.TextView; | ||
|
||
import com.ooyala.android.OoyalaException; | ||
import com.ooyala.android.OoyalaPlayer; | ||
import com.ooyala.android.item.Stream; | ||
import com.ooyala.android.player.StreamPlayer; | ||
import com.ooyala.android.util.DebugMode; | ||
|
||
import java.util.Set; | ||
import java.util.Timer; | ||
import java.util.TimerTask; | ||
|
||
|
||
/** | ||
* This is a new player which extends from StreamPlayer. | ||
* Extending from StreamPlayer is necessary to get it work with Ooyala SDK. | ||
* | ||
*/ | ||
public class SampleVideoStreamPlayer extends StreamPlayer { | ||
|
||
private static final String TAG = SampleVideoStreamPlayer.class.getSimpleName(); | ||
|
||
private int DURATION; | ||
private final int REFRESH_RATE = 250; | ||
|
||
private Timer timer; | ||
private int playhead = 0; | ||
private Handler timerHandler; | ||
private TextView textView; | ||
private LinearLayout linearLayout; | ||
|
||
private Stream stream; | ||
|
||
|
||
@Override | ||
public void init(OoyalaPlayer parent, Set<Stream> streams) { | ||
WifiManager wifiManager = (WifiManager)parent.getLayout().getContext().getSystemService(Context.WIFI_SERVICE); | ||
boolean isWifiEnabled = wifiManager.isWifiEnabled(); | ||
|
||
stream = Stream.bestStream(streams, isWifiEnabled); | ||
if (stream == null) { | ||
DebugMode.logE(TAG, "ERROR: Invalid Stream (no valid stream available)"); | ||
this._error = new OoyalaException(OoyalaException.OoyalaErrorCode.ERROR_PLAYBACK_FAILED, "Invalid Stream"); | ||
setState(OoyalaPlayer.State.ERROR); | ||
return; | ||
} | ||
|
||
if (parent == null) { | ||
this._error = new OoyalaException(OoyalaException.OoyalaErrorCode.ERROR_PLAYBACK_FAILED, "Invalid Parent"); | ||
setState(OoyalaPlayer.State.ERROR); | ||
return; | ||
} | ||
DURATION = parent.getCurrentItem().getDuration() != 0 ? parent.getCurrentItem().getDuration() : 15000 ; | ||
setParent(parent); | ||
initPlayer(); | ||
} | ||
|
||
public void initPlayer () { | ||
// create layout/view which will contain playerview | ||
linearLayout = new LinearLayout(_parent.getLayout().getContext()); | ||
linearLayout.setLayoutParams(new FrameLayout.LayoutParams( | ||
ViewGroup.LayoutParams.MATCH_PARENT, | ||
ViewGroup.LayoutParams.MATCH_PARENT, Gravity.CENTER)); | ||
linearLayout.setBackgroundColor(Color.BLACK); | ||
textView = new TextView(_parent.getLayout().getContext()); | ||
linearLayout.addView(textView); | ||
// Add newly created playerView to parent which is Ooyala player | ||
_parent.getLayout().addView(linearLayout); | ||
timerHandler = new Handler() { | ||
public void handleMessage(Message msg) { | ||
refresh(); | ||
} | ||
}; | ||
|
||
// if auto-play is enabled the state needs to be PLAYING | ||
if (_parent.getDesiredState() == OoyalaPlayer.DesiredState.DESIRED_PLAY) { | ||
setState(OoyalaPlayer.State.PLAYING); | ||
} else { | ||
setState(OoyalaPlayer.State.READY); | ||
} | ||
|
||
} | ||
|
||
@Override | ||
public void play() { | ||
if (timer == null) { | ||
timer = new Timer(); | ||
timer.scheduleAtFixedRate(new TimerTask() { | ||
@Override | ||
public void run() { | ||
timerHandler.sendEmptyMessage(0); | ||
} | ||
}, REFRESH_RATE, REFRESH_RATE); | ||
} | ||
setState(OoyalaPlayer.State.PLAYING); | ||
} | ||
|
||
@Override | ||
public int buffer() { | ||
return 100; | ||
} | ||
|
||
@Override | ||
public int duration() { | ||
return DURATION; | ||
} | ||
|
||
@Override | ||
public boolean seekable() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public int currentTime() { | ||
return playhead; | ||
} | ||
|
||
private void refresh() { | ||
// This method simulates video playback | ||
playhead += REFRESH_RATE; | ||
String text = " Sample Video Player Plugin " + String.valueOf((DURATION - playhead) / 1000) | ||
+ "\n\n\n" + stream.decodedURL().toString(); | ||
textView.setText(text); | ||
if (playhead >= DURATION && timer != null) { | ||
timer.cancel(); | ||
timer = null; | ||
setState(OoyalaPlayer.State.COMPLETED); | ||
} | ||
} | ||
} |
Binary file modified
BIN
+0 Bytes
(100%)
vendor/Ooyala/OoyalaAdobeAnalyticsSDK-Android/OoyalaAdobeAnalyticsSDK.jar
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
This was built with OoyalaSDK vv4.18.0_RC3 | ||
Git SHA: df07e94433d75a40e88b4d40585bbad0d39e9c15 | ||
Created On: Mon Sep 19 18:43:48 PDT 2016 | ||
Git SHA: 833362f9e8c3ad82f1cfa433478553a8aa3d2be2 | ||
Created On: Wed Sep 28 18:46:48 PDT 2016 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
This was built with OoyalaSDK vv4.18.0_RC3 | ||
Git SHA: df07e94433d75a40e88b4d40585bbad0d39e9c15 | ||
Git SHA: 833362f9e8c3ad82f1cfa433478553a8aa3d2be2 | ||
Tested with Google Cast Companion Library SHA 2cd84abb59c3383ce26dca0a09ead6a7a432efb0 | ||
Created On: Mon Sep 19 18:44:29 PDT 2016 | ||
Created On: Wed Sep 28 18:47:02 PDT 2016 |
Binary file modified
BIN
+0 Bytes
(100%)
vendor/Ooyala/OoyalaFreewheelSDK-Android/OoyalaFreewheelSDK.jar
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
This was built with OoyalaSDK vv4.18.0_RC3 | ||
Git SHA: df07e94433d75a40e88b4d40585bbad0d39e9c15 | ||
Git SHA: 833362f9e8c3ad82f1cfa433478553a8aa3d2be2 | ||
Tested with Freewheel SDK Version 6.5.0 | ||
Created On: Mon Sep 19 18:46:02 PDT 2016 | ||
Created On: Wed Sep 28 18:47:32 PDT 2016 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
This was built with OoyalaSDK vv4.18.0_RC3 | ||
Git SHA: df07e94433d75a40e88b4d40585bbad0d39e9c15 | ||
Git SHA: 833362f9e8c3ad82f1cfa433478553a8aa3d2be2 | ||
Tested with IMA SDK Version ima-android-v330.jar | ||
Created On: Mon Sep 19 18:46:13 PDT 2016 | ||
Created On: Wed Sep 28 18:47:36 PDT 2016 |
Binary file modified
BIN
+0 Bytes
(100%)
vendor/Ooyala/OoyalaNielsenSDK-Android/OoyalaNielsenSDK.jar
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
This was built with OoyalaSDK vv4.18.0_RC3 | ||
Git SHA: df07e94433d75a40e88b4d40585bbad0d39e9c15 | ||
Git SHA: 833362f9e8c3ad82f1cfa433478553a8aa3d2be2 | ||
Tested with Nielsen-Android-AppSDK 4.0.0.8 | ||
Created On: Mon Sep 19 18:46:23 PDT 2016 | ||
Created On: Wed Sep 28 18:47:41 PDT 2016 |
Binary file modified
BIN
+21 Bytes
(100%)
vendor/Ooyala/OoyalaPulseIntegration-Android/OoyalaPulseIntegration.jar
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
This was built with OoyalaSDK vv4.18.0_RC3 | ||
Git SHA: df07e94433d75a40e88b4d40585bbad0d39e9c15 | ||
Git SHA: 833362f9e8c3ad82f1cfa433478553a8aa3d2be2 | ||
Tested with Pulse SDK Version 2.2.16.14.0 | ||
Created On: Mon Sep 19 18:46:31 PDT 2016 | ||
Created On: Wed Sep 28 18:47:45 PDT 2016 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Ooyala SDK Versions vv4.18.0_RC3 | ||
Git SHA: df07e94433d75a40e88b4d40585bbad0d39e9c15 | ||
Created On: Mon Sep 19 18:45:26 PDT 2016 | ||
Git SHA: 833362f9e8c3ad82f1cfa433478553a8aa3d2be2 | ||
Created On: Wed Sep 28 18:47:20 PDT 2016 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Built with Ooyala SDK Version v4.18.0_RC3 | ||
native-skin Git SHA:f5002081ae310b151a35bfd346216d8f1c4d0018 | ||
Created On: Mon Sep 19 18:51:15 PDT 2016 | ||
Built with Ooyala SDK Version v4.16.0_RC6 | ||
native-skin Git SHA:caaf760f3dab7e51ee982c36770ca0737bad1ecb | ||
Created On: Wed Jul 20 18:11:21 PDT 2016 |
Oops, something went wrong.