Skip to content

Commit

Permalink
Update Apps for dev build: SDK SHA 833362f9 - Skin SHA caaf760f3
Browse files Browse the repository at this point in the history
  • Loading branch information
lental committed Sep 29, 2016
1 parent 2ba99ee commit 55a688d
Show file tree
Hide file tree
Showing 22 changed files with 740 additions and 431 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.ooyala.sample.players.PlayWithInitialTimePlayerActivity;
import com.ooyala.sample.players.PluginPlayerActivity;
import com.ooyala.sample.players.UnbundledPlayerActivity;
import com.ooyala.sample.players.SampleVideoPlayerActivity;
import com.ooyala.sample.utils.PlayerSelectionOption;

public class AdvancedPlaybackListActivity extends Activity implements OnItemClickListener {
Expand All @@ -46,6 +47,7 @@ public void onCreate(Bundle savedInstanceState) {
selectionMap.put(InsertAdPlayerActivity.getName(), new PlayerSelectionOption("Y1ZHB1ZDqfhCPjYYRbCEOz0GR8IsVRm1", "c0cTkxOqALQviQIGAHWY5hP0q9gU", "http://www.ooyala.com", InsertAdPlayerActivity.class) );
selectionMap.put(ChangeVideoPlayerActivity.getName(), new PlayerSelectionOption("Y1ZHB1ZDqfhCPjYYRbCEOz0GR8IsVRm1", "c0cTkxOqALQviQIGAHWY5hP0q9gU", "http://www.ooyala.com", ChangeVideoPlayerActivity.class) );
selectionMap.put(PluginPlayerActivity.getName(), new PlayerSelectionOption("lrZmRiMzrr8cP77PPW0W8AsjjhMJ1BBe", "R2d3I6s06RyB712DN0_2GsQS-R-Y", "http://www.ooyala.com", PluginPlayerActivity.class));
selectionMap.put(SampleVideoPlayerActivity.getName(), new PlayerSelectionOption("lrZmRiMzrr8cP77PPW0W8AsjjhMJ1BBe", "R2d3I6s06RyB712DN0_2GsQS-R-Y", "http://www.ooyala.com", SampleVideoPlayerActivity.class));
selectionMap.put(CustomControlsPlayerActivity.getName(), new PlayerSelectionOption("Y1ZHB1ZDqfhCPjYYRbCEOz0GR8IsVRm1", "c0cTkxOqALQviQIGAHWY5hP0q9gU", "http://www.ooyala.com", CustomControlsPlayerActivity.class) );
selectionMap.put(CustomOverlayPlayerActivity.getName(), new PlayerSelectionOption("Y1ZHB1ZDqfhCPjYYRbCEOz0GR8IsVRm1", "c0cTkxOqALQviQIGAHWY5hP0q9gU", "http://www.ooyala.com", CustomOverlayPlayerActivity.class) );
selectionMap.put(UnbundledPlayerActivity.getName(), new PlayerSelectionOption("http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4", "c0cTkxOqALQviQIGAHWY5hP0q9gU", "http://www.ooyala.com", UnbundledPlayerActivity.class));
Expand Down
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());
}

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

}
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;
}
}
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 not shown.
4 changes: 2 additions & 2 deletions vendor/Ooyala/OoyalaAdobeAnalyticsSDK-Android/VERSION
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 modified vendor/Ooyala/OoyalaCastSDK-Android/OoyalaCastSDK.aar
Binary file not shown.
4 changes: 2 additions & 2 deletions vendor/Ooyala/OoyalaCastSDK-Android/VERSION
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 vendor/Ooyala/OoyalaFreewheelSDK-Android/OoyalaFreewheelSDK.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions vendor/Ooyala/OoyalaFreewheelSDK-Android/VERSION
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 modified vendor/Ooyala/OoyalaIMASDK-Android/OoyalaIMASDK.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions vendor/Ooyala/OoyalaIMASDK-Android/VERSION
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 vendor/Ooyala/OoyalaNielsenSDK-Android/OoyalaNielsenSDK.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions vendor/Ooyala/OoyalaNielsenSDK-Android/VERSION
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 not shown.
4 changes: 2 additions & 2 deletions vendor/Ooyala/OoyalaPulseIntegration-Android/VERSION
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 modified vendor/Ooyala/OoyalaSDK-Android/OoyalaSDK.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions vendor/Ooyala/OoyalaSDK-Android/VERSION
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 modified vendor/Ooyala/OoyalaSkinSDK-Android/OoyalaSkinSDK.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions vendor/Ooyala/OoyalaSkinSDK-Android/VERSION
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
Loading

0 comments on commit 55a688d

Please sign in to comment.