use of android.media.SubtitleTrack.RenderingWidget in project android_frameworks_base by ResurrectionRemix.
the class MediaPlayer method setSubtitleAnchor.
/**
* The private version of setSubtitleAnchor is used internally to set mSubtitleController if
* necessary when clients don't provide their own SubtitleControllers using the public version
* {@link #setSubtitleAnchor(SubtitleController, Anchor)} (e.g. {@link VideoView} provides one).
*/
private synchronized void setSubtitleAnchor() {
if (mSubtitleController == null) {
final HandlerThread thread = new HandlerThread("SetSubtitleAnchorThread");
thread.start();
Handler handler = new Handler(thread.getLooper());
handler.post(new Runnable() {
@Override
public void run() {
Context context = ActivityThread.currentApplication();
mSubtitleController = new SubtitleController(context, mTimeProvider, MediaPlayer.this);
mSubtitleController.setAnchor(new Anchor() {
@Override
public void setSubtitleWidget(RenderingWidget subtitleWidget) {
}
@Override
public Looper getSubtitleLooper() {
return Looper.getMainLooper();
}
});
thread.getLooper().quitSafely();
}
});
try {
thread.join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
Log.w(TAG, "failed to join SetSubtitleAnchorThread");
}
}
}
use of android.media.SubtitleTrack.RenderingWidget in project android_frameworks_base by DirtyUnicorns.
the class MediaPlayer method setSubtitleAnchor.
/**
* The private version of setSubtitleAnchor is used internally to set mSubtitleController if
* necessary when clients don't provide their own SubtitleControllers using the public version
* {@link #setSubtitleAnchor(SubtitleController, Anchor)} (e.g. {@link VideoView} provides one).
*/
private synchronized void setSubtitleAnchor() {
if (mSubtitleController == null) {
final HandlerThread thread = new HandlerThread("SetSubtitleAnchorThread");
thread.start();
Handler handler = new Handler(thread.getLooper());
handler.post(new Runnable() {
@Override
public void run() {
Context context = ActivityThread.currentApplication();
mSubtitleController = new SubtitleController(context, mTimeProvider, MediaPlayer.this);
mSubtitleController.setAnchor(new Anchor() {
@Override
public void setSubtitleWidget(RenderingWidget subtitleWidget) {
}
@Override
public Looper getSubtitleLooper() {
return Looper.getMainLooper();
}
});
thread.getLooper().quitSafely();
}
});
try {
thread.join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
Log.w(TAG, "failed to join SetSubtitleAnchorThread");
}
}
}
use of android.media.SubtitleTrack.RenderingWidget in project android_frameworks_base by crdroidandroid.
the class MediaPlayer method setSubtitleAnchor.
/**
* The private version of setSubtitleAnchor is used internally to set mSubtitleController if
* necessary when clients don't provide their own SubtitleControllers using the public version
* {@link #setSubtitleAnchor(SubtitleController, Anchor)} (e.g. {@link VideoView} provides one).
*/
private synchronized void setSubtitleAnchor() {
if (mSubtitleController == null) {
final HandlerThread thread = new HandlerThread("SetSubtitleAnchorThread");
thread.start();
Handler handler = new Handler(thread.getLooper());
handler.post(new Runnable() {
@Override
public void run() {
Context context = ActivityThread.currentApplication();
mSubtitleController = new SubtitleController(context, mTimeProvider, MediaPlayer.this);
mSubtitleController.setAnchor(new Anchor() {
@Override
public void setSubtitleWidget(RenderingWidget subtitleWidget) {
}
@Override
public Looper getSubtitleLooper() {
return Looper.getMainLooper();
}
});
thread.getLooper().quitSafely();
}
});
try {
thread.join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
Log.w(TAG, "failed to join SetSubtitleAnchorThread");
}
}
}
use of android.media.SubtitleTrack.RenderingWidget in project platform_frameworks_base by android.
the class MediaPlayer method setSubtitleAnchor.
/**
* The private version of setSubtitleAnchor is used internally to set mSubtitleController if
* necessary when clients don't provide their own SubtitleControllers using the public version
* {@link #setSubtitleAnchor(SubtitleController, Anchor)} (e.g. {@link VideoView} provides one).
*/
private synchronized void setSubtitleAnchor() {
if (mSubtitleController == null) {
final HandlerThread thread = new HandlerThread("SetSubtitleAnchorThread");
thread.start();
Handler handler = new Handler(thread.getLooper());
handler.post(new Runnable() {
@Override
public void run() {
Context context = ActivityThread.currentApplication();
mSubtitleController = new SubtitleController(context, mTimeProvider, MediaPlayer.this);
mSubtitleController.setAnchor(new Anchor() {
@Override
public void setSubtitleWidget(RenderingWidget subtitleWidget) {
}
@Override
public Looper getSubtitleLooper() {
return Looper.getMainLooper();
}
});
thread.getLooper().quitSafely();
}
});
try {
thread.join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
Log.w(TAG, "failed to join SetSubtitleAnchorThread");
}
}
}
use of android.media.SubtitleTrack.RenderingWidget in project android_frameworks_base by AOSPA.
the class MediaPlayer method setSubtitleAnchor.
/**
* The private version of setSubtitleAnchor is used internally to set mSubtitleController if
* necessary when clients don't provide their own SubtitleControllers using the public version
* {@link #setSubtitleAnchor(SubtitleController, Anchor)} (e.g. {@link VideoView} provides one).
*/
private synchronized void setSubtitleAnchor() {
if (mSubtitleController == null) {
final HandlerThread thread = new HandlerThread("SetSubtitleAnchorThread");
thread.start();
Handler handler = new Handler(thread.getLooper());
handler.post(new Runnable() {
@Override
public void run() {
Context context = ActivityThread.currentApplication();
mSubtitleController = new SubtitleController(context, mTimeProvider, MediaPlayer.this);
mSubtitleController.setAnchor(new Anchor() {
@Override
public void setSubtitleWidget(RenderingWidget subtitleWidget) {
}
@Override
public Looper getSubtitleLooper() {
return Looper.getMainLooper();
}
});
thread.getLooper().quitSafely();
}
});
try {
thread.join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
Log.w(TAG, "failed to join SetSubtitleAnchorThread");
}
}
}
Aggregations