Skip to content

Commit

Permalink
Merge pull request jellyfin#45 from jasonmeisel/bug-fixes
Browse files Browse the repository at this point in the history
fix bugs that were preventing successful casting
  • Loading branch information
dkanada authored Jul 28, 2020
2 parents ce92cfe + 1ea5ad4 commit 5c1e2e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/maincontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ window.mediaManager.addEventListener(cast.framework.events.category.CORE,
console.log(event);
});

const playbackMgr = new playbackManager();
const playbackMgr = new playbackManager(window.castReceiverContext, window.mediaManager);

const playbackConfig = new cast.framework.PlaybackConfig();
// Set the player to start playback as soon as there are five seconds of
Expand Down
10 changes: 6 additions & 4 deletions src/components/playbackManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class playbackManager {
return;
}

getIntros(firstItem.serverAddress, firstItem.accessToken, firstItem.userId, firstItem).then(function (intros) {
getIntros(firstItem.serverAddress, firstItem.accessToken, firstItem.userId, firstItem).then(intros => {

tagItems(intros.Items, {
userId: firstItem.userId,
Expand All @@ -63,6 +63,8 @@ export class playbackManager {

this.activePlaylist = options.items;
this.activePlaylist.currentPlaylistIndex = -1;
window.playlist = this.activePlaylist;

this.playNextItem(options, stopPlayer);
}

Expand Down Expand Up @@ -114,11 +116,11 @@ export class playbackManager {
$scope.isChangingStream = false;
setAppStatus('loading');

getMaxBitrate(item.MediaType).then(function (maxBitrate) {
getMaxBitrate(item.MediaType).then(maxBitrate => {

var deviceProfile = getDeviceProfile(maxBitrate);

jellyfinActions.getPlaybackInfo(item, maxBitrate, deviceProfile, options.startPositionTicks, options.mediaSourceId, options.audioStreamIndex, options.subtitleStreamIndex).then(function (result) {
jellyfinActions.getPlaybackInfo(item, maxBitrate, deviceProfile, options.startPositionTicks, options.mediaSourceId, options.audioStreamIndex, options.subtitleStreamIndex).then(result => {

if (validatePlaybackInfoResult(result)) {

Expand All @@ -128,7 +130,7 @@ export class playbackManager {

if (mediaSource.RequiresOpening) {

jellyfinActions.getLiveStream(item, result.PlaySessionId, maxBitrate, deviceProfile, options.startPositionTicks, mediaSource, null, null).then(function (openLiveStreamResult) {
jellyfinActions.getLiveStream(item, result.PlaySessionId, maxBitrate, deviceProfile, options.startPositionTicks, mediaSource, null, null).then(openLiveStreamResult => {

openLiveStreamResult.MediaSource.enableDirectPlay = supportsDirectPlay(openLiveStreamResult.MediaSource);
this.playMediaSource(result.PlaySessionId, item, openLiveStreamResult.MediaSource, options);
Expand Down

0 comments on commit 5c1e2e6

Please sign in to comment.