0

video playback problems

Jeremy, having some trouble with your code. Can't play video. Any help would be appreciated. Would really like to figure this out, and I've emailed tv-widgets and no one's been able to help out with advice. What we have is below. Don't need anything fancy at this point, we just want it to work. Thanks


var VideoFullscreenPlayerView = new KONtx.Class({
ClassName: 'VideoFullscreenPlayerView',

Extends: KONtx.system.FullscreenView,

_backHandler: function(event) {
event.preventDefault();
this._stopVideoConfirmationDialog();
},

_stopVideoConfirmationDialog: function() {
log("popping stop confirmation dialog");
var stopCallback = (function() { this.player.stop(); }).bindTo(this);
new KONtx.dialogs.Alert({
title: $_('stop_video_dialog_title'),
message: $_('stop_video_dialog_message'),
buttons: [
{ label: $_('continue_playing') },
{ label: $_('stop_playing'), callback: stopCallback }
]
}).show();
},

_hideDialog: function() {
if(this._stopDialog && this._stopDialog.hide && this._stopDialog.hide.call) {
this._stopDialog.hide();
}
},

createView: function() {
var self = this;
this.controls.overlay = new KONtx.control.VideoTransportOverlay().appendTo(this);

this.player = new KONtx.videoplayer({


viewID: this.config.viewID,
playlist: [ { url:

"http://t2.mf.scd.yahoo.com/test/video/noise.mp4"

} ],



events: {
onStateChange: function(event) {
if(event.payload.newState == event.payload.videoplayer.states.STOP) {
self._switchBackToSidebar();
}
},
onPlaylistEnd: function(event) {
self._switchBackToSidebar();
},
onVideoLoadError: function(event) {
self._showErrorDialog();
}
}
});


this.player.attachAccessory(this.controls.overlay);
},

_showErrorDialog: function() {
var self = this;
new KONtx.dialogs.Alert({
title: $_('video_error_dialog_title'),
message: $_('video_error_dialog_message'),
buttons: [
{ label: $_('dialog_ok_button'), callback: function() {
self._switchBackToSidebar();
} }
]
}).show();
},

_unbindHandler: function() {
if(this._boundHandler) {
this._boundHandler.unsubscribeFrom(KONtx.application, ['onActivateBackButton','onViewChangeInitiated']);
this._boundHandler = null;
}
},

_switchBackToSidebar: function() {
this._hideDialog();
this._unbindHandler();
KONtx.application.previousView();
},

_switchToPostRoll: function() {
this._hideDialog();
this._unbindHandler();
KONtx.HostEventManager.send('setWaitIndicator',1);
KONtx.application.loadView('view-HBOSeries');
},

_getPlaylist: function() {
var urls = [];
for each(var format in this.persist.selectedVideo.formats) {
if(format.tech == "wmp") {
switch(true) {
case format.bitrate >= 1000:
urls['high'] = format.url;
break;
case format.bitrate >= 500 && format.bitrate < 1000:
urls['medium'] = format.url;
break;
case format.bitrate < 500:
urls['low'] = format.url;
break;
}
}
}
return [{ urls: urls }];
},

focusView: function() {
this.controls.overlay.focus();
},

updateView: function() {
this._boundHandler = this._backHandler.subscribeTo(KONtx.application, ['onActivateBackButton','onViewChangeInitiated'], this);
this.controls.overlay.resetState();
try {
//this.player.setBandwidthBracket(KONtx.messages.fetch("bandwidth_bracket"));
this.player.startPlaylist();
} catch (e) {
log("Caught an exception, so going back to sidebar");
this._showErrorDialog();
}
},

hideView: function() {
this._unbindHandler();
}
});

by
14 Replies
  • Oh, and we've tried a few different URLs, and I realize the one in there now doesn't work.
    0
  • QUOTE (Adam @ Jul 30 2009, 01:04 PM) <{POST_SNAPBACK}>
    Oh, and we've tried a few different URLs, and I realize the one in there now doesn't work.



    What is the issue exactly? I apologize, but I'm primary point of contact for all of the video widget partners and I don't recognize your name right off.

    -Jeremy
    0
  • QUOTE (Jeremy Johnstone @ Jul 30 2009, 05:12 PM) <{POST_SNAPBACK}>
    What is the issue exactly? I apologize, but I'm primary point of contact for all of the video widget partners and I don't recognize your name right off.

    -Jeremy


    I'm with HBO. The developer that was originally working on this recently handed it off to take care of a few other things, and I've been able to do everything else that we need but can't seem to get the video to work at all (maybe I'm missing something simple with my code / didn't get everything out of the WDK. SORRY if my question was stupid, I just wanted some help). On our samsung an error message indicates that there's a problem and suggests to try the video later. Am I using the right sample code- that's how it was when it was handed off to me- because I realize there's been updates to the platform since we originally got everything from you all. I read one of the threads regarding playback on samsungs specifically, and was curious as to if that issue was ever resolved, or if the problem is just with the code on my end. I'd really just like some help to get video running on our platform. We were trying to have everything setup for an internal demo to see if something like this could actually benefit HBO, and we'd like to have functional video playback for that. I also read that you produced a sample for video that you were emailing out; maybe that's all I need to get started?
    0
  • Wondering if it could be an encoding issue... is the following video encoded properly? http://hbo.wmod.rd.llnw.net/u/webcon/films..._rev_wm_384.wmv
    0
  • QUOTE (Adam @ Jul 31 2009, 07:47 AM) <{POST_SNAPBACK}>
    Wondering if it could be an encoding issue... is the following video encoded properly? http://hbo.wmod.rd.llnw.net/u/webcon/films..._rev_wm_384.wmv


    That's a strong possibility. I'll test it and report back asap.

    Thanks!

    -Jeremy
    0
  • QUOTE (Jeremy Johnstone @ Aug 3 2009, 07:47 AM) <{POST_SNAPBACK}>
    That's a strong possibility. I'll test it and report back asap.

    Thanks!

    -Jeremy



    much appreciated
    0
  • to clarify, the video is in WM9, with WM9.1 audio and an828kbps VBR
    0
  • Hi Jeremy,
    I was using the videoplayer earlier and then updated the latest WDK sent by Russ on 4th August 09. Once I checked for the videoplayer, I found that the video has stopped playing which was working earlier.

    I havent changed any code except the way playlist was added and the change is in below code line. Please let me know in case any more changes needs to be made in order to support this new WDK.

    Earlier in console it used to show percentage buffering done, also the wait indicator used to work on full screen, this time I am unable to see any, thus dubious whether even its working or not.

    CODE
    		
    this.controls.videoPlayer.changePlaylist([{urls : [{bitrate: 30, url : 'http://10.124.223.66/vod/media/Seg_1.mp4'}]}]);
    //this.controls.videoPlayer.changePlaylist([{bitrate: 10, url : 'http://10.124.223.66/vod/media/Seg_1.mp4'}]);
    this.controls.videoPlayer.startPlaylist();


    Thanks,
    Ashish Jain
    0
  • QUOTE (ashish @ Aug 6 2009, 04:42 AM) <{POST_SNAPBACK}>
    Hi Jeremy,
    I was using the videoplayer earlier and then updated the latest WDK sent by Russ on 4th August 09. Once I checked for the videoplayer, I found that the video has stopped playing which was working earlier.

    I havent changed any code except the way playlist was added and the change is in below code line. Please let me know in case any more changes needs to be made in order to support this new WDK.

    Earlier in console it used to show percentage buffering done, also the wait indicator used to work on full screen, this time I am unable to see any, thus dubious whether even its working or not


    Please pay attention to the sticky posts in the forums. They are _important_ and should be considered mandatory reading. This one in particular:

    http://developer.yahoo.net/forum/index.php?showtopic=2043

    -Jeremy
    0
  • QUOTE (Jeremy Johnstone @ Aug 10 2009, 01:20 PM) <{POST_SNAPBACK}>
    Please pay attention to the sticky posts in the forums. They are _important_ and should be considered mandatory reading. This one in particular:

    http://developer.yahoo.net/forum/index.php?showtopic=2043

    -Jeremy


    Hi Jeremy,
    I added the viewId as I already read the post. Please see the code which I am using for Player creation.

    CODE
    createView: function(){
    var self = this;
    this.controls.backButton = new KONtx.control.BackButton({
    label: '',
    guid: 'videoPlayer-backButton'
    }).appendTo(this);

    this.controls.overlay = new KONtx.control.VideoTransportOverlay().appendTo(this);
    this.controls.videoPlayer = new KONtx.videoplayer({
    viewId: this.config.viewId,
    events: {
    onStateChange: function(event){
    if (event.payload.newState == event.payload.videoplayer.states.STOP) {
    self._switchBackToPreview();
    }
    },
    onPlaylistEnd: function(event){
    self._switchBackToPreview();
    },
    onVideoLoadError: function(event){
    log('############got an ERROR');
    }
    }

    });
    this.controls.videoPlayer.attachAccessory(this.controls.overlay);

    },


    In UpdateView am setting the URL like this:

    CODE
        updateView: function(){
    var self = this;
    this.selectedValues= this.persist;

    this.controls.backButton.setText('Back To Movie Details');

    this.URL = (this.selectedValues.movie.clipUrl != 'undefined') || this.URL;
    log('########URL is:' + self.URL);
    this.controls.videoPlayer.changePlaylist([{urls : [{bitrate: 11, url : self.URL}]}]);

    this.controls.videoPlayer.startPlaylist();

    },


    The URL (MP4 file) which I am passing is being accessed from browser and is running fine.
    I am getting the text "got an error" when I am looking into the console which shows that the onVideoLoadError callback has been called. I am not sure why the file which is accessible via browser is giving an error in player.

    In case am doing something wrong please let me know.

    Thanks,
    Ashish Jain
    0
  • Any update on the videoplayer playback?
    Please help.

    Thanks,
    Ashish Jain
    0
  • Ashish,
    I don't see any immediate problems in your code. It is possible that your video is not a supported encoding (harsh, I know). If you can run the Video Sample widget from the wdk, then that is probably your issue.

    Try editing the Video Sample widget and inserting your URL to make sure it is not a code problem.

    Please let me know if you still have problems.
    Jim
    0
  • Thanks Jim,
    Your suggestion to use Video Sample Widget worked for me and copying the code in my widget same as it is in the Video Sample, made my widget player working.
    I was not setting the bandwidthRate in Kontx.Messages, this was the only change I could see in the code sample I was using earlier and the code from Video Sample Widget.

    As far as video is considered, I am not using my own video, I am using a video which is from some educational institution's website (.mpg) and this was working with previous version of WDK which I was using. So encoding was not the problem. May be the code was wrong.
    Anyways thanks a lot for providing the approach.

    I used two items in playlist but the video player is not moving to next item of playlist automatically once the 1st item is finished playing. Do I need to do something for that also, or the player handles it on its own?

    Thanks,
    Ashish Jain
    0
  • Ashish,
    The playlist should allow multiple videos. Can you post the code you are using to generate the playlist?
    Thanks,
    Jim
    0

Recent Posts

in General - Yahoo! TV Widgets