Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My recoded Apiplayer issue #207

Open
ALTRedFireMRT84 opened this issue Jan 23, 2025 · 1 comment
Open

My recoded Apiplayer issue #207

ALTRedFireMRT84 opened this issue Jan 23, 2025 · 1 comment

Comments

@ALTRedFireMRT84
Copy link

I have recoded my own apiplayer for a reason. I want to use it for my upcoming video streaming demand. You can have a look with my source code:
https://github.com/ALTRedFireMRT84/PretzelTV/tree/main
I'm having a problem with getting a video to load and to display correctly. Only I get an audio playing for one split second before the audio disappears. What am I doing wrong here? It's either that or there's a mistake in one or some of the classes I tried importing:

var videoData = {id:"x36sfib", flvUrl:"http://192.168.1.192:443/api/get_video?platform=dailymotion&id=x36sfib&format=flv&cm2=0", fallbackConn:null, conn:null, getDefaultBufferTime:function (config)
{
return 2;
}, isGetVideoLoggable:false, partnerTrackingToken:null};

var videoPlayer = new VideoPlayer("dailymotion");
videoPlayer.initialize(new PlayerConfigurationData(),new sounds.v2.SoundController());

var videoLoader = new VideoLoader(new PlayerConfigurationData(), new sounds.v2.SoundController(), "dailymotion");
videoLoader.registerEvent("onLoadNewVideo",sugar.utils.Delegate.build(videoPlayer, videoPlayer.onLoadNewVideo));
videoLoader.registerEvent("onVideoDataError",sugar.utils.Delegate.build(videoPlayer, videoPlayer.onVideoDataError));
videoLoader.loadVideoByVideoData(videoData);
videoPlayer.play();

function pauseVideo()
{
	videoPlayer.pause();
}

function seekVideo(seconds)
{
	videoPlayer.seekTo(seconds,true);
}

videoPlayer.onVideoLoaderStateChange = function(event)
{
	switch (event.type)
	{
		case "onPlay" :
			trace("Video is playing");
			break;
		case "onBuffering" :
			trace("Video is buffering");
			break;
		case "onPaused" :
			trace("Video is paused");
			break;
		case "onEnd" :
			trace("Video has ended");
			break;
	}
};
stop();
@ALTRedFireMRT84
Copy link
Author

Also this is the traces I get:
here we go
_level0.videoWrapper
VideoWrapper exists: true
VideoWrapper.video exists: true
Video is playing now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant